现在小组内做代码已经有了统一的目标,类名改为J字开头。这些颜色属性(13种)是我看了Java类搬来的,还发现Java有这种设置方法:Color(255,
255, 255),而Flash中是:my_color.setRGB(0xRRGGBB)。如果两种方法都有了那不是更爽,一会儿把这种方法添上~
/*临时temp @class temp.graphics.JColor @package temp.graphics @author 高翔 @tooltip 静态的JColor类 */ class temp.graphics.JColor { //white白色 static var white:Number = 0xffffff; //lightGray亮灰 static var lightGray:Number = 0xc0c0c0; //gray灰 static var gray:Number = 0x808080; //darkGray深灰 static var darkGray:Number = 0x404040; //black黑 static var black:Number = 0x000000; //red红 static var red:Number = 0xff0000; //pink粉红 static var pink:Number = 0xffafaf; //orange橙 static var orange:Number = 0xffc800; //yellow黄 static var yellow:Number = 0xffff00; //green绿 static var green:Number = 0x00ff00; //magenta洋红/紫 static var magenta:Number = 0xff00ff; //cyan青 static var cyan:Number = 0x00ffff; //blue蓝 static var blue:Number = 0x0000ff; private function JColor() { } } |
使用方法:
import temp.graphics.JGDI; import temp.graphics.JPen; import temp.graphics.JColor; trace(JColor.orange); //静态属性,可直接调用: JColor.orange var pen:JPen = new JPen(2, JColor.orange, 100); JGDI.target = _root JGDI.drawRect(pen, 1, 1, 50, 75); |
PS:前面的JGDI和JPen类可参考这里:http://www.5dblog.com/vip/5shan/index.asp?id=35326