我想知道如何构建一个给出颜色代码和
显示该颜色的渐变。例如:
function generate_color(int colorindex)
{ .......
.......
Generate 10 pale colors of this color.
}
请帮我
迈克尔引用的代码相当可怕。但解决方案很简单。如果您只考虑灰度图像,可能会更清楚:
function create_pallette($start, $end, $entries=10)
{
$inc=($start - $end)/($entries-1);
$out=array(0=>$start);
for ($x=1; $x<$entries;$x++) {
$out[$x]=$start+$inc * $x;
}
return $out;
}
仅使用 3D 矢量 (RGB) 而不是 1D 矢量。
C.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)