C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
UiColor Struct Reference

Structure representing a color in the UI. More...

#include <ui_backend.h>

Collaboration diagram for UiColor:
[legend]

Data Fields

union { 
   struct { 
      uint8_t   a 
      uint8_t   b 
      uint8_t   g 
      uint8_t   r 
   } 
   struct { 
      uint32_t   rgba 
   } 
}; 
union { 
   struct { 
      uint8_t   a 
      uint8_t   b 
      uint8_t   g 
      uint8_t   r 
   } 
   struct { 
      uint32_t   rgba 
   } 
}; 
uint32_t idx
uint32_t index
bool use_rgb

Detailed Description

Structure representing a color in the UI.

The UiColor structure represents a color that can be used for foreground and background styling in the UI. It includes RGB values for true color support, as well as an index for palette-based colors. The use_rgb flag indicates whether the RGB values should be used (true) or if the index should be used to reference a color from a predefined palette (false). This allows for flexibility in color representation, supporting both modern terminals with true color capabilities and older terminals that rely on a limited color palette.

See also
UiStyle

Definition at line 129 of file ui_backend.h.

Field Documentation

◆ [union]

union { ... } UiColor

◆ [union]

union { ... } UiColor

◆ a

uint8_t UiColor::a

Definition at line 132 of file ui_backend.h.

◆ b

uint8_t UiColor::b

Definition at line 133 of file ui_backend.h.

◆ g

uint8_t UiColor::g

Definition at line 134 of file ui_backend.h.

◆ idx

uint32_t UiColor::idx

Definition at line 19 of file ui_colors.c.

◆ index

uint32_t UiColor::index

Definition at line 142 of file ui_backend.h.

◆ r

uint8_t UiColor::r

Definition at line 135 of file ui_backend.h.

◆ rgba

uint32_t UiColor::rgba

Definition at line 138 of file ui_backend.h.

◆ use_rgb

bool UiColor::use_rgb

Definition at line 141 of file ui_backend.h.


The documentation for this struct was generated from the following files: