Colors

AppCUI support 16 colors (foreground and background) for each displayed character. All colors are described using AppCUI::Graphics::Color enum:

enum class Color : unsigned char
{
    Black       = 0x00,
    DarkBlue    = 0x01,
    DarkGreen   = 0x02,
    Teal        = 0x03,
    DarkRed     = 0x04,
    Magenta     = 0x05,
    Olive       = 0x06,
    Silver      = 0x07,
    Gray        = 0x08,
    Blue        = 0x09,
    Green       = 0x0A,
    Aqua        = 0x0B,
    Red         = 0x0C,
    Pink        = 0x0D,
    Yellow      = 0x0E,
    White       = 0x0F,
    Transparent = 0x10,
};

Transparent value can be used to specify that the existing color should be used, instead of replacing it with the new one.

Colors and RGB

Colors can be used with AppCUI::Graphics::Image object. There is also a string format available where each character represents a color. The following table explaings the colors and characters that can be used to represent it in a string view.

Color

RGB

String representation

Color::Black

R:0, G:0, B:0 #000000

0 , (space), . (point)

Color::DarkBlue

R:0, G:0, B:128 #000080

1 , B

Color::DarkGreen

R:0, G:128, B:0 #008000

2 , G

Color::Teal

R:0, G:128, B:128 #008080

3 , T

Color::DarkRed

R:128, G:0, B:0 #800000

4 , R

Color::Magenta

R:128, G:0, B:128 #800080

5 , M, m

Color::Olive

R:128, G:128, B:0 #808000

6

Color::Silver

R:192, G:192, B:192 #C0C0C0

7 , S

Color::Gray

R:128, G:128, B:128 #808080

8 , S

Color::Blue

R:0, G:0, B:255 #0000FF

9 , b

Color::Green

R:0, G:255, B:0 #00FF00

G

Color::Aqua

R:0, G:255, B:255 #00FFFF

A , a, t

Color::Red

R:255, G:0, B:0 #FF0000

r

Color::Pink

R:255, G:0, B:255 #FF00FF

P , p

Color::Yellow

R:255, G:255, B:0 #FFFF00

Y , y

Color::White

R:255, G:255, B:255 #FFFFFF

W , w