非常有用的FLASH as公式(二)

来源:互联网 发布:电脑摄像头特效软件 编辑:程序博客网 时间:2024/06/05 10:44

转换为十进制:
trace(hexValue);

-------------------------------------
十进制转换为十六进制:
trace(decimalValue.toString(16));

-------------------------------------
颜色合成:
color24 = red << 16 | green << 8 | blue;
color32 = alpha << 24 | red << 16 | green << 8 | blue;

-------------------------------------
颜色提取:
red = color24 >> 16;
green = color24 >> 8 & 0xFF;
blue = color24 & 0xFF;
alpha = color32 >> 24;
red = color32 >> 16 & 0xFF;
green = color32 >> 8 & 0xFF;
blue = color232 & 0xFF;

-------------------------------------
过控制点的曲线:
// xt, yt is the point you want to draw through
// x0, y0 and x2, y2 are the end points of the curve
x1 = xt * 2 – (x0 + x2) / 2;
y1 = yt * 2 – (y0 + y2) / 2;
moveTo(x0, y0);
curveTo(x1, y1, x2, y2);

原创粉丝点击