text color, background color
Standard and portable approach to set the text and background colors on the console. This function memorizes one previous text and background color (and not more) and can be recalled with color name 'previous'.
Indirect parameter passing is disabled
0, 1, 3
No. | Type | Description |
---|---|---|
1 input |
string | Color names See Console Text and Background Colors for all supported colors and theme color names. Specify all color names in lower-case, including backgroud colors. Default value: default |
Alt. 1 input |
string | Color as hexadecimal value The string must begin wiht '#' followed by six hexadecimal digits (0-9, A-F or a-f). The three 2-digit pairs apply to red, green and blue. |
Alt. 1 input |
set | Color in set The paramter set provided must contain three numeric values with range between 0 and 255. Values below 0 are raised to 0. Values above 255 are capped to 255. Example: {128,0,255} describes violet. |
Alt. 1 input |
numeral | Red Specify the red color intensity. Values below 0 are raised to 0. Values above 255 are capped to 255. |
Opt. 2 input |
numeral | Green Specify the green color intensity. Values below 0 are raised to 0. Values above 255 are capped to 255. |
Opt. 3 input |
numeral | Blue Specify the blue color intensity. Values below 0 are raised to 0. Values above 255 are capped to 255. |
Invalid color specified
savecode
echo( Default color );
text color( red ); // Will not show up in red in this documentation
echo( Red text );
text color; // Back to default color
echo( Back to default color );
Default color
Red text
Back to default color
Highly recommend to set default color before the app is finishing.