#include <ttx/terminal/color.h>
|
| enum class | Type : u8 { Default
, Palette
, Custom
, Dynamic
} |
| enum | Palette : u8 {
Black
, Red
, Green
, Yellow
,
Blue
, Magenta
, Cyan
, LightGrey
,
DarkGrey
, LightRed
, LightGreen
, LightYellow
,
LightBlue
, LightMagenta
, LightCyan
, White
} |
| using | IsAtom = void |
|
| constexpr friend auto | tag_invoke (di::Tag< di::parser::create_parser_in_place >, di::InPlaceType< Color >) |
◆ IsAtom
◆ Palette
| Enumerator |
|---|
| Black | |
| Red | |
| Green | |
| Yellow | |
| Blue | |
| Magenta | |
| Cyan | |
| LightGrey | |
| DarkGrey | |
| LightRed | |
| LightGreen | |
| LightYellow | |
| LightBlue | |
| LightMagenta | |
| LightCyan | |
| White | |
◆ Type
| Enumerator |
|---|
| Default | Color is the default (unset SGR).
|
| Palette | Color is a palette color (256 colors are available).
|
| Custom | Color is true color (r, b, g fully specified).
|
| Dynamic | Color is dynamic (e.g. for selection use reverse video).
|
◆ Color() [1/4]
| ttx::terminal::Color::Color |
( |
| ) |
|
|
default |
◆ Color() [2/4]
| ttx::terminal::Color::Color |
( |
Palette | c | ) |
|
|
inlineconstexpr |
◆ Color() [3/4]
| ttx::terminal::Color::Color |
( |
u8 | r, |
|
|
u8 | g, |
|
|
u8 | b ) |
|
inlineconstexpr |
◆ Color() [4/4]
| ttx::terminal::Color::Color |
( |
Type | t | ) |
|
|
inlineexplicitconstexpr |
◆ brightness()
| auto ttx::terminal::Color::brightness |
( |
| ) |
const -> f64 |
Dim the given color by a percentage.
This has no affect on non rgb color types.
◆ dimmed()
| auto ttx::terminal::Color::dimmed |
( |
u32 | dim_factor | ) |
const -> Color |
◆ from_name()
| auto ttx::terminal::Color::from_name |
( |
di::StringView | color | ) |
-> di::Result< Color > |
|
static |
◆ from_string()
| auto ttx::terminal::Color::from_string |
( |
di::StringView | color | ) |
-> di::Result< Color > |
|
static |
◆ is_custom()
| auto ttx::terminal::Color::is_custom |
( |
| ) |
const |
|
inline |
◆ is_default()
| auto ttx::terminal::Color::is_default |
( |
| ) |
const |
|
inline |
◆ is_dynamic()
| auto ttx::terminal::Color::is_dynamic |
( |
| ) |
const |
|
inline |
Compute the perceived brightness of a color.
This is meant to determine if a color theme is "light" or "dark".
This will return 0.0 for non rgb color types.
◆ is_palette()
| auto ttx::terminal::Color::is_palette |
( |
| ) |
const |
|
inline |
◆ operator<=>()
| auto ttx::terminal::Color::operator<=> |
( |
Color const & | other | ) |
const |
|
default |
◆ operator==()
| auto ttx::terminal::Color::operator== |
( |
Color const & | other | ) |
const -> bool=default |
|
default |
◆ to_string()
| auto ttx::terminal::Color::to_string |
( |
| ) |
const -> di::String |
◆ value_or()
| auto ttx::terminal::Color::value_or |
( |
Color | other | ) |
const |
|
inline |
◆ tag_invoke
| friend auto tag_invoke |
( |
di::Tag< di::parser::create_parser_in_place > | , |
|
|
di::InPlaceType< Color > | ) |
|
friend |
| u8 ttx::terminal::Color::b = 0 |
| u8 ttx::terminal::Color::g = 0 |
| u8 ttx::terminal::Color::r = 0 |
◆ type
The documentation for this struct was generated from the following files: