PHP imagecolorclosest - 取得与指定的颜色最接近的颜色的索引值

PHP 教程 · 2019-01-31 10:42:10

imagecolorclosest — 取得与指定的颜色最接近的颜色的索引值。

语法

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

返回图像调色板中与指定的 RGB 值最"接近"的颜色。

指定的颜色与调色板中的每个颜色的"距离"的计算方法是把 RGB 值当成三维空间中点的坐标。

如果从文件创建了图像,只有图像中使用了的颜色会被辨析。仅出现在调色板中的颜色不会被辨析。

相关文章

  • imagecolorexact() 取得指定颜色的索引值。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

HTML5

HTML5

Matthew David / Focal Press / 2010-07-29 / USD 39.95

Implement the powerful new multimedia and interactive capabilities offered by HTML5, including style control tools, illustration tools, video, audio, and rich media solutions. Understand how HTML5 is ......一起来看看 《HTML5》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具