7#include "../exception.hpp"
11enum class theme_color :
unsigned char {
40constexpr size_t num_theme_colors =
static_cast<size_t>(theme_color::_size);
42[[nodiscard]]
inline theme_color theme_color_from_string(std::string_view str)
45 return theme_color::blue;
46 }
else if (str ==
"green") {
47 return theme_color::green;
48 }
else if (str ==
"indigo") {
49 return theme_color::indigo;
50 }
else if (str ==
"orange") {
51 return theme_color::orange;
52 }
else if (str ==
"pink") {
53 return theme_color::pink;
54 }
else if (str ==
"purple") {
55 return theme_color::purple;
56 }
else if (str ==
"red") {
57 return theme_color::red;
58 }
else if (str ==
"teal") {
59 return theme_color::teal;
60 }
else if (str ==
"yellow") {
61 return theme_color::yellow;
62 }
else if (str ==
"gray") {
63 return theme_color::gray;
64 }
else if (str ==
"gray2") {
65 return theme_color::gray2;
66 }
else if (str ==
"gray3") {
67 return theme_color::gray3;
68 }
else if (str ==
"gray4") {
69 return theme_color::gray4;
70 }
else if (str ==
"gray5") {
71 return theme_color::gray5;
72 }
else if (str ==
"gray6") {
73 return theme_color::gray6;
74 }
else if (str ==
"foreground") {
75 return theme_color::foreground;
76 }
else if (str ==
"border") {
77 return theme_color::border;
78 }
else if (str ==
"fill") {
79 return theme_color::fill;
80 }
else if (str ==
"accent") {
81 return theme_color::accent;
82 }
else if (str ==
"text_select") {
83 return theme_color::text_select;
84 }
else if (str ==
"cursor") {
85 return theme_color::cursor;
86 }
else if (str ==
"incomplete_glyph") {
87 return theme_color::incomplete_glyph;
89 throw parse_error(
"Unknown theme color '{}'", str);