37 rgb text_background_col;
43 static std::string char_to_hex(
unsigned char c) {
44 static const char hex_chars[16] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' };
46 s[0] = hex_chars[(c & 0xF0) >> 4];
47 s[1] = hex_chars[(c & 0x0F) >> 0];
51 static std::string rgb_to_hex(
const rgb& c) {
52 unsigned char r =
static_cast<unsigned char>(255.0f * c.R());
53 unsigned char g =
static_cast<unsigned char>(255.0f * c.G());
54 unsigned char b =
static_cast<unsigned char>(255.0f * c.B());
55 std::string s =
"0x" + char_to_hex(r) + char_to_hex(g) + char_to_hex(b);
70 void set_index(
int idx);
71 int get_index()
const;
74 int spacing()
const {
return spacing_; }
75 void spacing(
int i) { spacing_ = i; }
77 DEF_COLOR_MEMBER_METHODS(background)
78 DEF_COLOR_MEMBER_METHODS(group)
79 DEF_COLOR_MEMBER_METHODS(control)
80 DEF_COLOR_MEMBER_METHODS(border)
81 DEF_COLOR_MEMBER_METHODS(text)
82 DEF_COLOR_MEMBER_METHODS(text_background)
83 DEF_COLOR_MEMBER_METHODS(selection)
84 DEF_COLOR_MEMBER_METHODS(highlight)
85 DEF_COLOR_MEMBER_METHODS(warning)
86 DEF_COLOR_MEMBER_METHODS(shadow)
88 cgv::signal::signal<const theme_info&> on_change;
97 cgv::signal::connect(theme.on_change,
this, &theme_observer::handle_theme_change);
102 cgv::signal::disconnect(theme.on_change,
this, &theme_observer::handle_theme_change);