imagecolorclosesthwb

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

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

Descrizione

imagecolorclosesthwb(
    GdImage $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.

Elenco dei parametri

image

Una risorsa immagine, restituita da una delle funzioni di creazione immagine, come imagecreatetruecolor().

red

Valore della componente rossa.

green

Valore della componente verde.

blue

Valore della componente blu.

Valori restituiti

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

Log delle modifiche

Versione Descrizione
8.0.0 image expects a GdImage instance now; previously, a valid gd resource was expected.

Esempi

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

Vedere anche: