imagecolorclosesthwb

(PHP 4 >= 4.0.1, PHP 5, PHP 7)

imagecolorclosesthwbGet the index of the color which has the hue, white and blackness

Descrição

imagecolorclosesthwb ( resource $image , int $red , int $green , int $blue ) : int

Get the index of the color which has the hue, white and blackness nearest the given color.

Parâmetros

image

Um resource de imagem, retornado por funções de criação de imagens, como imagecreatetruecolor().

red

Valor do componente vermelho.

green

Valor do componente verde.

blue

Valor do componente azul.

Valor Retornado

Returns an integer with the index of the color which has the hue, white and blackness nearest the given color.

Exemplos

Exemplo #1 Example of using imagecolorclosesthwb()

<?php
$im 
imagecreatefromgif('php.gif');

echo 
'HWB: ' imagecolorclosesthwb($im116115152);

imagedestroy($im);
?>

O exemplo acima irá imprimir algo similar à:

HWB: 33

Veja Também