imagecolorclosesthwb
(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)
imagecolorclosesthwb — 取得與給定顏色最接近的色度的黑白色的索引
說明
imagecolorclosesthwb(
resource
int
int
int
): int
resource
$image,int
$red,int
$green,int
$blue): int
取得與給定顏色最接近的色度的黑白色的索引。
參數
-
image 由圖像建立函式(例如imagecreatetruecolor())返回的 GdImage 對象。
-
red 紅色成分的值。
-
green 綠色成分的值。
-
blue 藍色成分的值。
返回值
返回一個整數,是給定顏色最接近的色度的黑白色的索引。
範例
示例 #1 使用 imagecolorclosesthwb() 的例子
<?php
$im = imagecreatefromgif('php.gif');
echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152);
imagedestroy($im);
?> 以上例程的輸出類似於:
HWB: 33
更新日誌
| 版本 | 說明 |
|---|---|
| 5.3.0 | 在 Windows 平臺上可用 |
參見
- imagecolorclosest() - 取得與指定的顏色最接近的顏色的索引值