Flash渲染技术公式

来源:互联网 发布:阿里云三级域名泛解析 编辑:程序博客网 时间:2024/05/06 07:45

转换为十进制:

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 = colore32 >> 24;

red = color32 >> 16 & 0xFF;

green = color32 >> 8 & 0xFF;

blue = color32 & 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);

原创粉丝点击