(PHP 4 >= 4.0.1, PHP 5)
imagecolorclosesthwb — 取得與給定顏色最接近的色度的黑白色的索引
說明
int imagecolorclosesthwb ( resource$image
, int $red
, int $green
, int $blue
)
取得與給定顏色最接近的色度的黑白色的索引。
參數(shù)
image
由圖象創(chuàng)建函數(shù)(例如imagecreatetruecolor())返回的圖象資源。
red
紅色成分的值。
green
綠色成分的值。
blue
藍(lán)色成分的值。
返回值
返回一個(gè)整數(shù),是給定顏色最接近的色度的黑白色的索引。
范例
Example #1 使用 imagecolorclosesthwb() 的例子
<?php
$im = imagecreatefromgif('php.gif');
echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152);
imagedestroy($im);
?>
以上例程的輸出類似于:
HWB: 33
更新日志
版本 說明 5.3.0 在 Windows 平臺(tái)上可用
參見
imagecolorclosest() - 取得與指定的顏色最接近的顏色的索引值