The 8-bit color integer is generated with the following formula:
Code: Select all
color = ( [red] * 65536) + ( [green] * 256) + ( [blue] * 1)
Code: Select all
sprintf(colorbuf, "#%6.6x", color);
Code: Select all
color = ( [red] * 65536) + ( [green] * 256) + ( [blue] * 1)
Code: Select all
sprintf(colorbuf, "#%6.6x", color);
Code: Select all
color.toString(16)
Code: Select all
// White
color = (255 * 65536) + (255 * 256) + (255 * 1); // 16777215
color.toString(16); // 'ffffff'