(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)
imagecolorclosesthwb — Get the index of the color which has the hue, white and blackness
Get the index of the color which has the hue, white and blackness nearest the given color.
image
Об'єкт GdImage, що повертається однією з функцій створення зображення, такою як imagecreatetruecolor().
red
Значення червоного компонента.
green
Значення зеленого компонента.
blue
Значення синього компонента.
Returns an integer with the index of the color which has the hue, white and blackness nearest the given color.
Версія | Опис |
---|---|
8.0.0 |
Тепер image має бути примірником
GdImage. Раніше очікувався
gd -resource.
|
Приклад #1 Example of using imagecolorclosesthwb()
<?php
$im = imagecreatefromgif('php.gif');
echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152);
?>
Поданий вище приклад виведе щось схоже на:
HWB: 33