Rose
Theme.h
1 
8 #pragma once
9 
10 #include "Color.h"
11 #include "Types.h"
12 
13 namespace rose {
14 
15  enum class ThemeColor : size_t {
16  Base,
17  Top,
18  Bottom,
19  Left,
20  Right,
21  Invert,
22  Text,
23  Red,
24  Green,
25  Yellow,
26  RedText,
27  GreenText,
28  YellowText,
29  };
30 
35  class Theme {
36  protected:
37  Theme() = default;
38  public:
39 
40  static Theme &getTheme() {
41  static Theme instance{};
42  return instance;
43  }
44 
48  color::HSVA BaseColorHSVA{200.f, .00, .25, 1.0};
49 
50  std::array<color::HSVA, 13> _hsva{{
51  BaseColorHSVA,
52  BaseColorHSVA.modValue(0.2),
53  BaseColorHSVA.modValue(-0.15),
54  BaseColorHSVA.modValue(0.1),
55  BaseColorHSVA.modValue(-0.15),
56  BaseColorHSVA.modValue(-0.075),
57  BaseColorHSVA.contrasting(),
58  {0.f, 1.f, 0.55f, 1.f},
59  {79.f, 1.f, .4f, 1.f},
60  {50.f, 1.f, 0.55f, 1.f},
61  {0.f, 1.f, 0.75f, 1.f},
62  {79.f, 1.f, 0.75f, 1.f},
63  {50.f, 1.f, 0.75f, 1.f}
64  }};
65 
66  std::array<color::RGBA, 13> _rgba{{
67  _hsva[0].toRGBA(),
68  _hsva[1].toRGBA(),
69  _hsva[2].toRGBA(),
70  _hsva[3].toRGBA(),
71  _hsva[4].toRGBA(),
72  _hsva[5].toRGBA(),
73  _hsva[6].toRGBA(),
74  _hsva[7].toRGBA(),
75  _hsva[8].toRGBA(),
76  _hsva[9].toRGBA(),
77  _hsva[10].toRGBA(),
78  _hsva[11].toRGBA(),
79  _hsva[12].toRGBA()
80  }};
81 
82  color::RGBA rgba(ThemeColor themeColor) {
83  return _rgba[static_cast<std::size_t>(themeColor)];
84  };
85 
86  color::HSVA hsva(ThemeColor themeColor) {
87  return _hsva[static_cast<std::size_t>(themeColor)];
88  }
89 
93  std::string
94  TextFont{"FreeSans"},
95  BoldFont{"FreeSansBold"},
96  ObliqueFont{"FreeSansOblique"},
97  BoldObliqueFont{"FreeSansBoldOblique"},
98  FixedFont{"FreeMono"},
99  FixedBoldFont{"FreeMonoBold"},
100  FixedObliqueFont{"FreeMonoOblique"},
101  FixedBoldObliqueFont{"FreeMonoBoldOblique"},
102  EntypoFont{"entypo"};
103 
107  int ButtonPointSize{30},
108  LabelPointSize{30},
109  TextPointSize{20};
110 
114  int ButtonPadding{5};
115 
119  Size ImageLabelSize{40,40};
120 
124  FrameSettings CleanFrame{
125  { rgba(ThemeColor::Base), rgba(ThemeColor::Invert)},
127  };
128 
129  FrameSettings BevelFrame{
130  { rgba(ThemeColor::Base), rgba(ThemeColor::Invert)},
132  };
133 
134  FrameSettings SemiBevelFrame{
135  { rgba(ThemeColor::Base), rgba(ThemeColor::Invert)},
136  {BorderStyle::NotchIn, BorderStyle::BevelIn}
137  };
138  };
139 }
140 
A set of values that provide defaults forming a cohesive visual and operational theme.
Definition: Theme.h:35
Red Green Blue Alpha representation of a color.
Definition: Color.h:64
A notched border that looks like a trench surrounding the frame.
Definition: Frame.h:28
constexpr HSVA contrasting() const
Get a new contrasting colour to this HSL colour.
Definition: Color.h:248
No border.
Hue Saturation Value (or Brightness) representation of a color.
Definition: Color.h:184
A beveled border that gives the illusion the frame stands up from the display.
Definition: Frame.h:25
A size in integer dimensions.
Definition: Types.h:230
constexpr RGBA toRGBA() const noexcept
Convert to RGBA in an array of floats.
Definition: Color.h:262
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
Definition: Types.h:75
A beveled in border.