电脑爱好者,提供IT资讯信息及各类编程知识文章介绍,欢迎大家来本站学习电脑知识。 最近更新 | 联系我们 RSS订阅本站最新文章
电脑爱好者
站内搜索: 
当前位置:首页>> PHP>>PHP颜色调配器:

PHP颜色调配器

来源:www.cncfan.com | 2006-1-11 | (有2878人读过)


<table align=center border=0 cellspacing=0 cellpadding=0>
<?
for ($y=0;$y<16;$y++)
{
echo "<tr height=4>n";

for ($x=0;$x<16;$x++)
{
$abs00=sqrt(($x*$x)+($y*$y));
if ($abs00>16)
$abs00=16;

$abs01=sqrt(($x*$x)+((16-$y)*(16-$y)));
if ($abs01>16)
$abs01=16;

$abs10=sqrt(((16-$x)*(16-$x))+($y*$y));
if ($abs10>16)
$abs10=16;

$red=((16-$abs00)*16)-1;
if ($red<0)
$red=0;

$green=((16-$abs01)*16)-1;
if ($green<0)
$green=0;
$blue= ((16-$abs10)*16)-1;
if ($blue<0)
$blue=0;

$col = sprintf("%02x%02x%02x",$red,$green,$blue);
echo " <td width=4 bgcolor="#$col">($red,$green,$blue=$col)<a href="$PHP_SELF?color=$col"><img src=images/blank.gif width=4 height=4" border=0 alt="$col"></a></td>n";
}

echo "</tr>n";
}
?>
</table>
<?php
echo "<P><CENTER><font color=$color><U><B>大家好,这个颜色可以了吗?</B></U></font></CENTER>";
?>
PHP热门文章排行
网站赞助商
购买此位置

 

关于我们 | 网站地图 | 文档一览 | 友情链接| 联系我们

Copyright © 2003-2024 电脑爱好者 版权所有 备案号:鲁ICP备09059398号