Color

A color is stored as integer value in format 0xBBGGRR. The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue.

 

Examples:

0x000000 - black

0xFFFFFF - white

0x0000FF - red

0x00FF00 - green

0xFF0000 - blue

0x00FFFF - yellow (red+green)

0xC0C0C0 - gray

0x808080 - dark gray

0x008000 - dark green

 

To compose a color at run time from red, green and blue components in range 0 to 255, use function ColorFromRGB. Example: yellow=ColorFromRGB(255 255 0).

 

To get a system color, use function GetSysColor. Example: ttcol=GetSysColor(WINAPI.COLOR_INFOTEXT).

 

To parse color to red, green and blue components, use function ColorToRGB.

 

When capturing icon in the Icon Editor, you can see the color of the top-left pixel.

 

The following macro displays the color from the mouse pointer.

 

str s.format("0x%X" pixel(xm ym))
out s