imagecolorclosesthwb()

收藏:0   阅读:29

imagecolorclosesthwb — 取得与指定的颜色最接近的色度的黑白色的索引。

语法

int imagecolorclosesthwb ( resource $image , int $red , int $green , int $blue )

取得与给定颜色最接近的色度的黑白色的索引。

注意:此函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。

参数

返回值

返回一个整数,是给定颜色最接近的色度的黑白色的索引。

实例

<?php
$im = imagecreatefromgif(‘php.gif‘);

echo ‘HWB: ‘ . imagecolorclosesthwb($im, 116, 115, 152);

imagedestroy($im);
?>

以上实例的输出类似于:

HWB: 33

相关文章

© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!