“Php imagecolorclosesthwb”的版本间差异
本页内容
(创建页面,内容为“{{DISPLAYTITLE:imagecolorclosesthwb()}}20 = PHP imagecolorclosesthwb - 取得与指定的颜色最接近的色度的黑白色的索引 = PHP 图像处理 imagecolorclosesthwb — 取得与指定的颜色最接近的色度的黑白色的索引。 === 语法 === <sample title="" desc="" lang="php" hererun="1"> int imagecolorclosesthwb ( resource $image , int $red , int $green , int $blue ) </sample> 取得与给定…”) |
(没有差异)
|
2022年8月17日 (三) 22:32的最新版本
PHP imagecolorclosesthwb - 取得与指定的颜色最接近的色度的黑白色的索引
imagecolorclosesthwb — 取得与指定的颜色最接近的色度的黑白色的索引。
语法
示例
int imagecolorclosesthwb ( resource $image , int $red , int $green , int $blue )
取得与给定颜色最接近的色度的黑白色的索引。
注意:此函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。
参数
- image 由图像创建函数(例如 imagecreatetruecolor())返回的图像资源。
- red 红色成分的值。
- green 绿色成分的值。
- blue 蓝色成分的值。
返回值
返回一个整数,是给定颜色最接近的色度的黑白色的索引。
==
示例
<?php
$im = imagecreatefromgif('php.gif');
echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152);
imagedestroy($im);
?>
以上实例的输出类似于:
示例
HWB: 33
相关文章
- imagecolorclosest() 取得与指定的颜色最接近的颜色的索引值。