Google
搜索www.dodoakn 搜索DoDoKan

函数:ImageColorResolve()

ImageColorResolve
计算色表上指定或最接近颜色的索引值。
语法: int imagecolorresolve(int im, int red, int green, int blue);
返回值: 整数
函数种类: 图形处理

内容说明

本函数用来计算调色盘中指定 RGB 颜色的色素索引值。参数 red、green、blue 分别为红、绿、蓝三原色,也就是所谓的 RGB 值。若无指定颜色则取得最接近的颜色。无论如何本函数都会有索引值返回。

参考

ImageColorClosest()  ImageColorExact()  

函数:ImageColorExact()

ImageColorExact
计算色表上指定颜色索引值。
语法: int imagecolorexact(int im, int red, int green, int blue);
返回值: 整数
函数种类: 图形处理

内容说明

本函数用来计算调色盘中指定 RGB 颜色的色素索引值。参数 red、green、blue 分别为红、绿、蓝三原色,也就是所谓的 RGB 值。若调色盘中没有指定的颜色,则返回 -1。

参考

ImageColorClosest()  

函数:ImageColorClosest()

ImageColorClosest
计算色表中与指定颜色最接近者。
语法: int imagecolorclosest(int im, int red, int green, int blue);
返回值: 整数
函数种类: 图形处理

内容说明

本函数用来计算调色盘中与指定 RGB 颜色最接近的颜色。参数 red、green、blue 分别为红、绿、蓝三原色,也就是所谓的 RGB 值。

参考

ImageColorExact()  

函数:ImageColorAt()

ImageColorAt
取得图中指定点颜色的索引值。
语法: int imagecolorat(int im, int x, int y);
返回值: 整数
函数种类: 图形处理

内容说明

本函数可取得图形中某指定点的颜色索引值 (index)。

参考

ImageColorSet()  ImageColorsForIndex()  

函数:ImageColorAllocate()

ImageColorAllocate
匹配颜色。
语法: int imagecolorallocate(int im, int red, int green, int blue);
返回值: 整数
函数种类: 图形处理

内容说明

本函数用来匹配图形的颜色,供其它绘图函数使用。参数 im 表示图形的 handle。参数 red、green、blue 是色彩三原色,其值从 0 至 255。

使用范例

<?
$white = ImageColorAllocate($im, 255,255,255);
$black = ImageColorAllocate($im, 0,0,0);
?>