PHP imagecolorclosesthwb - 取得与指定的颜色最接近的色度的黑白色的索引
PHP 教程
· 2019-01-31 11:11:53
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() 取得与指定的颜色最接近的颜色的索引值。
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Beginning XML with DOM and Ajax
Sas Jacobs / Apress / 2006-06-05 / USD 39.99
Don't waste time on 1,000-page tomes full of syntax; this book is all you need to get ahead in XML development. Renowned web developer Sas Jacobs presents an essential guide to XML. Beginning XML with......一起来看看 《Beginning XML with DOM and Ajax》 这本书的介绍吧!