colour [--basic <basic ANSI colour>] [--rgb <RGB value>] <colour>
colour --basic 1 7
colour --basic 1 7 cpair --foreground 7 0
colour --rgb 0x191970 4
Define the specified colour index (in the range 0
to 7
) to use the specified basic ANSI colour (in the range 0
to 7
) and the specified 24-bit RGB colour (in the range 0x000000
to 0xffffff
). The basic ANSI colour will be used on consoles which do not support arbitrary RGB colours.
If the RGB value is omitted, then only the basic ANSI colour will be used. If the basic ANSI colour is omitted, then the default colour (white foreground, black or transparent background) will be used.
The default colour definitions are:
Success | The colour was successfully defined |
---|---|
Failure | The colour was not successfully defined |
This command is available only when the build option CONSOLE_CMD
is enabled.
To change the default foreground and background colour used by iPXE, you must use the cpair
command to redefine colour pair 0 to use your chosen colours.
Not all consoles support full RGB colours. You can use the basic ANSI colour as a fallback. For example, to define colour 6 as turqouise, falling back to cyan if RGB colours are not available:
colour --basic 6 --rgb 0x40e0d0 6
colour
command.