`prev Menu next`

color mode (original enhancement)
`SET COLOR MODE "NATIVE"`
transfers to the mode of using 24-bit integers for color indices.
On this mode, a color index is the 24-bit integer of which the lower 8-bit indicates red, the middle 8-bit green, the upper 8-bit blue.
ASK PIXEL ARRAY or ASK PIXEL VALUE can obtain every color.
But on this mode, the SET COLOR MIX statement is invalid.
the largest color index is 16777215.
The image shall not be cleared after SET COLOR MODE is executed.
Background color, line color, point color, area color, and text color shall be inherited.
Thus CLEAR fills using the color that had been assigned by SET COLOR MIX(0) before the mode transferred.
SET COLOR MODE "REGULAR"
transfers the color mode to regular.
Line color, text color, point color, area color shall be set to 1.
ASK COLOR MODE s$
substitute s$ with the current color mode.

Supplied Function

COLORINDEX(r,g,b)
The color index of color of the strength red r, green g, blue b, where each strength is between 0 and 1.
Example

    10 SET COLOR MODE "NATIVE"
    20 SET TEXT COLOR ColorIndex(0,0,1)
    30 PLOT TEXT ,AT 0,0:"Hello"
    40 END

[Note]
BVAL functions can be used for assigning the color index using a hexadecimal number.
For example, the color blue is BVAL("FF0000",16).
Note that the byte order is the reverse of that in HTML.