Functions | |
__extern uint8_t | cucul_attr_to_ansi (uint32_t) |
Get DOS ANSI information from attribute. | |
__extern uint8_t | cucul_attr_to_ansi_fg (uint32_t) |
Get ANSI foreground information from attribute. | |
__extern uint8_t | cucul_attr_to_ansi_bg (uint32_t) |
Get ANSI background information from attribute. | |
__extern uint16_t | cucul_attr_to_rgb12_fg (uint32_t) |
Get 12-bit RGB foreground information from attribute. | |
__extern uint16_t | cucul_attr_to_rgb12_bg (uint32_t) |
Get 12-bit RGB background information from attribute. | |
__extern void | cucul_attr_to_argb64 (uint32_t, uint8_t[8]) |
Get 64-bit ARGB information from attribute. |
__extern uint8_t cucul_attr_to_ansi | ( | uint32_t | attr | ) |
Get the ANSI colour pair for a given attribute. The returned value is an 8-bit value whose higher 4 bits are the background colour and lower 4 bits are the foreground colour.
If the attribute has ARGB colours, the nearest colour is used. Special attributes such as CUCUL_DEFAULT and CUCUL_TRANSPARENT are not handled and are both replaced with CUCUL_LIGHTGRAY for the foreground colour and CUCUL_BLACK for the background colour.
This function never fails. If the attribute value is outside the expected 32-bit range, higher order bits are simply ignored.
attr | The requested attribute value. |
References CUCUL_BLACK, and CUCUL_LIGHTGRAY.
__extern uint8_t cucul_attr_to_ansi_fg | ( | uint32_t | attr | ) |
Get the ANSI foreground colour value for a given attribute. The returned value is either one of the CUCUL_RED, CUCUL_BLACK etc. predefined colours, or the special value CUCUL_DEFAULT meaning the media's default foreground value, or the special value CUCUL_TRANSPARENT.
If the attribute has ARGB colours, the nearest colour is returned.
This function never fails. If the attribute value is outside the expected 32-bit range, higher order bits are simply ignored.
attr | The requested attribute value. |
__extern uint8_t cucul_attr_to_ansi_bg | ( | uint32_t | attr | ) |
Get the ANSI background colour value for a given attribute. The returned value is either one of the CUCUL_RED, CUCUL_BLACK etc. predefined colours, or the special value CUCUL_DEFAULT meaning the media's default background value, or the special value CUCUL_TRANSPARENT.
If the attribute has ARGB colours, the nearest colour is returned.
This function never fails. If the attribute value is outside the expected 32-bit range, higher order bits are simply ignored.
attr | The requested attribute value. |
__extern uint16_t cucul_attr_to_rgb12_fg | ( | uint32_t | attr | ) |
Get the 12-bit foreground colour value for a given attribute. The returned value is a native-endian encoded integer with each red, green and blue values encoded on 8 bits in the following order:
This function never fails. If the attribute value is outside the expected 32-bit range, higher order bits are simply ignored.
attr | The requested attribute value. |
References CUCUL_DEFAULT, CUCUL_LIGHTGRAY, and CUCUL_TRANSPARENT.
__extern uint16_t cucul_attr_to_rgb12_bg | ( | uint32_t | attr | ) |
Get the 12-bit background colour value for a given attribute. The returned value is a native-endian encoded integer with each red, green and blue values encoded on 8 bits in the following order:
This function never fails. If the attribute value is outside the expected 32-bit range, higher order bits are simply ignored.
attr | The requested attribute value. |
References CUCUL_BLACK, CUCUL_DEFAULT, and CUCUL_TRANSPARENT.
__extern void cucul_attr_to_argb64 | ( | uint32_t | attr, | |
uint8_t | argb[8] | |||
) |
Get the 64-bit colour and alpha values for a given attribute. The values are written as 8-bit integers in the argb array in the following order:
This function never fails. If the attribute value is outside the expected 32-bit range, higher order bits are simply ignored.
attr | The requested attribute value. | |
argb | An array of 8-bit integers. |
References CUCUL_BLACK, CUCUL_DEFAULT, CUCUL_LIGHTGRAY, and CUCUL_TRANSPARENT.
Referenced by cucul_render_canvas().