| ||
Youve added a few more valuable tools to your collection in this chapter, mostly relating to handling color .
Convert hex to decimal:
trace(hexValue);
Convert decimal to hex:
trace(decimalValue.toString(16);
Combine component colors:
color24 = red << 16 green << 8 blue;
Extract component colors:
red = color24 >> 16; green = color24 >> 8 & 0xFF; blue = color24 & 0xFF;
Draw a curve through a point:
// 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);
| ||