|
iPXE
|
ANSI colour definitions. More...
#include <stdio.h>#include <errno.h>#include <ipxe/ansiesc.h>#include <ipxe/ansicol.h>#include <config/colour.h>Go to the source code of this file.
Macros | |
| #define | ANSICOL_DEFINE(basic, rgb) ( ( (basic) << 28 ) | (rgb) ) |
| Construct ANSI colour definition. More... | |
| #define | ANSICOL_BASIC(ansicol) ( (ansicol) >> 28 ) |
| Extract basic colour from ANSI colour definition. More... | |
| #define | ANSICOL_RGB(ansicol) ( ( (ansicol) >> 0 ) & 0xffffffUL ) |
| Extract 24-bit RGB value from ANSI colour definition. More... | |
| #define | ANSICOL_RED(ansicol) ( ( (ansicol) >> 16 ) & 0xff ) |
| Extract 24-bit RGB value red component from ANSI colour definition. More... | |
| #define | ANSICOL_GREEN(ansicol) ( ( (ansicol) >> 8 ) & 0xff ) |
| Extract 24-bit RGB value green component from ANSI colour definition. More... | |
| #define | ANSICOL_BLUE(ansicol) ( ( (ansicol) >> 0 ) & 0xff ) |
| Extract 24-bit RGB value blue component from ANSI colour definition. More... | |
| #define | ANSICOL_DEFAULT(basic) |
| Construct default ANSI colour definition. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| int | ansicol_define (unsigned int colour, unsigned int basic, uint32_t rgb) |
| Define ANSI colour. More... | |
| void | ansicol_set (unsigned int colour, unsigned int which) |
| Set ANSI colour (using colour definitions) More... | |
| void | ansicol_reset_magic (void) |
| Reset magic colour. More... | |
| void | ansicol_set_magic_transparent (void) |
| Set magic colour to transparent. More... | |
Variables | |
| static uint32_t | ansicols [] |
| ANSI colour definitions. More... | |
| static uint8_t | ansicol_magic = COLOR_NORMAL_BG |
| Magic basic colour. More... | |
ANSI colour definitions.
Definition in file ansicoldef.c.
| #define ANSICOL_DEFINE | ( | basic, | |
| rgb | |||
| ) | ( ( (basic) << 28 ) | (rgb) ) |
Construct ANSI colour definition.
| basic | Basic colour |
| rgb | 24-bit RGB value (or ANSICOL_NO_RGB) |
| ansicol | ANSI colour definition |
Definition at line 45 of file ansicoldef.c.
| #define ANSICOL_BASIC | ( | ansicol | ) | ( (ansicol) >> 28 ) |
Extract basic colour from ANSI colour definition.
| ansicol | ANSI colour definition |
| basic | Basic colour |
Definition at line 53 of file ansicoldef.c.
| #define ANSICOL_RGB | ( | ansicol | ) | ( ( (ansicol) >> 0 ) & 0xffffffUL ) |
Extract 24-bit RGB value from ANSI colour definition.
| ansicol | ANSI colour definition |
| rgb | 24-bit RGB value |
Definition at line 61 of file ansicoldef.c.
| #define ANSICOL_RED | ( | ansicol | ) | ( ( (ansicol) >> 16 ) & 0xff ) |
Extract 24-bit RGB value red component from ANSI colour definition.
| ansicol | ANSI colour definition |
| red | Red component |
Definition at line 69 of file ansicoldef.c.
| #define ANSICOL_GREEN | ( | ansicol | ) | ( ( (ansicol) >> 8 ) & 0xff ) |
Extract 24-bit RGB value green component from ANSI colour definition.
| ansicol | ANSI colour definition |
| green | Green component |
Definition at line 77 of file ansicoldef.c.
| #define ANSICOL_BLUE | ( | ansicol | ) | ( ( (ansicol) >> 0 ) & 0xff ) |
Extract 24-bit RGB value blue component from ANSI colour definition.
| ansicol | ANSI colour definition |
| blue | Blue component |
Definition at line 85 of file ansicoldef.c.
| #define ANSICOL_DEFAULT | ( | basic | ) |
Construct default ANSI colour definition.
| basic | Basic colour |
| ansicol | ANSI colour definition |
Colours default to being just a basic colour. If the colour matches the normal UI text background colour, then its basic colour value is set to ANSICOL_MAGIC.
Definition at line 97 of file ansicoldef.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| int ansicol_define | ( | unsigned int | colour, |
| unsigned int | basic, | ||
| uint32_t | rgb | ||
| ) |
Define ANSI colour.
| colour | Colour index |
| basic | Basic colour |
| rgb | 24-bit RGB value (or ANSICOL_NO_RGB) |
| rc | Return status code |
Definition at line 125 of file ansicoldef.c.
References ANSICOL_BASIC, ANSICOL_DEFINE, ANSICOL_NO_RGB, ANSICOL_RGB, ansicols, colour, DBGC, and EINVAL.
Referenced by colour_exec().
| void ansicol_set | ( | unsigned int | colour, |
| unsigned int | which | ||
| ) |
Set ANSI colour (using colour definitions)
Set ANSI colour (when no colour definition support is present)
| colour | Colour index |
| which | Foreground/background selector |
Definition at line 149 of file ansicoldef.c.
References ANSICOL_BASIC, ANSICOL_BLUE, ANSICOL_DEFINE, ANSICOL_GREEN, ansicol_magic, ANSICOL_NO_RGB, ANSICOL_RED, ansicols, assert(), colour, COLOUR_DEFAULT, CSI, and printf().
| void ansicol_reset_magic | ( | void | ) |
Reset magic colour.
Definition at line 179 of file ansicoldef.c.
References ansicol_magic, and COLOR_NORMAL_BG.
Referenced by efifb_configure(), and vesafb_configure().
| void ansicol_set_magic_transparent | ( | void | ) |
Set magic colour to transparent.
Definition at line 189 of file ansicoldef.c.
References ansicol_magic, and COLOR_DEFAULT.
Referenced by efifb_configure(), and vesafb_configure().
|
static |
ANSI colour definitions.
Definition at line 103 of file ansicoldef.c.
Referenced by ansicol_define(), and ansicol_set().
|
static |
Magic basic colour.
Definition at line 115 of file ansicoldef.c.
Referenced by ansicol_reset_magic(), ansicol_set(), and ansicol_set_magic_transparent().
1.8.15