如何将 颜色RBG转为10进制
这是一个颜色生成器flash,拿出来跟大家分享一下
下面是这段代码:
var _loc4 = 7;
//每个色块间的间隔
inc = 51;
//以下这三个初始数据(inc,inc2,inc3)也许和颜色的RPG之有关,但详细的不清楚,哪位大侠可以解释下吗
inc2 = 13056;
//
inc3 = 3342336;
//
i = 0;
this.createEmptyMovieClip("container", this.getNextHighestDepth());
while (i<216)
{
bb = i%6;
gg = int(i/6)%6;
rr = int(i/36);
trace("bb="+bb+" gg="+gg+" rr="+rr);
var _loc3 = container.attachMovie("colorOrigin", "comc"+i, i);
newc = new Color(_loc3);
c = rr*inc3+gg*inc2+bb*inc;//
trace("c="+c);
newc.setRGB(c);
xinc = int(i%108/6);
yinc = int(i/108)*6+i%6;
trace("xinc="+xinc+" yinc="+yinc);
_loc3._y = 15+xinc*_loc4;
_loc3._x = yinc*_loc4;
trace("_loc3._y="+_loc3._y+" _loc3._x="+_loc3._x);
++i;
}
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |