array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), 'this' => array ( 0 => 'function.imagecolorclosesthwb.php', 1 => 'imagecolorclosesthwb', 2 => 'Get the index of the color which has the hue, white and blackness', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD and Image Funzioni', ), 'prev' => array ( 0 => 'function.imagecolorclosestalpha.php', 1 => 'imagecolorclosestalpha', ), 'next' => array ( 0 => 'function.imagecolordeallocate.php', 1 => 'imagecolordeallocate', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/image/functions/imagecolorclosesthwb.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(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.
imageUna risorsa immagine, restituita da una delle funzioni di creazione immagine, come imagecreatetruecolor().
redValore della componente rossa.
greenValore della componente verde.
blueValore della componente blu.
Returns an integer with the index of the color which has the hue, white and blackness nearest the given color.
| Versione | Descrizione |
|---|---|
| 8.0.0 |
image expects a GdImage
instance now; previously, a valid gd resource was expected.
|
Example #1 Example of using imagecolorclosesthwb()
<?php
$im = imagecreatefromgif('php.gif');
echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152);
?>Il precedente esempio visualizzerĂ qualcosa simile a:
HWB: 33