![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
imagecolorclosesthwb() function in PHP
The imagecolorclosesthwb() function gets the index of the color which has the hue, white and blackness
Syntax
imagecolorclosesthwb ( $img, $red, $green, $blue )
Parameters
img: Create image with imagecreatetruecolor()
red: Red color component
green: Green color component
blue: Blue color component
Return
The imagecolorclosesthwb() function returns an integer with the index of the color which has the hue, white and blackness nearest the given color.
Example
The following is an example:
<?php $img = imagecreatefromgif('https://www.tutorialspoint.com/images/html.gif'); echo 'HWB = '. imagecolorclosesthwb($img, 50, 110, 90); imagedestroy($img); ?>
Output
The following is the output:
HWB = 87
Advertisements