7#include "theme_text_style.hpp"
8#include "../exception.hpp"
11namespace hi::inline v1 {
13enum class theme_color :
unsigned char {
44constexpr auto saturated_theme_colors =
std::array{
57[[nodiscard]]
inline theme_color theme_color_from_string(std::string_view str)
60 return theme_color::blue;
61 }
else if (str ==
"green") {
62 return theme_color::green;
63 }
else if (str ==
"indigo") {
64 return theme_color::indigo;
65 }
else if (str ==
"orange") {
66 return theme_color::orange;
67 }
else if (str ==
"pink") {
68 return theme_color::pink;
69 }
else if (str ==
"purple") {
70 return theme_color::purple;
71 }
else if (str ==
"red") {
72 return theme_color::red;
73 }
else if (str ==
"teal") {
74 return theme_color::teal;
75 }
else if (str ==
"yellow") {
76 return theme_color::yellow;
77 }
else if (str ==
"gray") {
78 return theme_color::gray;
79 }
else if (str ==
"gray2") {
80 return theme_color::gray2;
81 }
else if (str ==
"gray3") {
82 return theme_color::gray3;
83 }
else if (str ==
"gray4") {
84 return theme_color::gray4;
85 }
else if (str ==
"gray5") {
86 return theme_color::gray5;
87 }
else if (str ==
"gray6") {
88 return theme_color::gray6;
89 }
else if (str ==
"foreground") {
90 return theme_color::foreground;
91 }
else if (str ==
"border") {
92 return theme_color::border;
93 }
else if (str ==
"fill") {
94 return theme_color::fill;
95 }
else if (str ==
"accent") {
96 return theme_color::accent;
97 }
else if (str ==
"text_select") {
98 return theme_color::text_select;
99 }
else if (str ==
"primary_cursor") {
100 return theme_color::primary_cursor;
101 }
else if (str ==
"secondary_cursor") {
102 return theme_color::secondary_cursor;
104 throw parse_error(std::format(
"Unknown theme color '{}'", str));