@@ -94,22 +94,38 @@ namespace tsl {
94
94
95
95
}
96
96
97
+ /* *
98
+ * @brief RGBA4444 Color structure
99
+ */
100
+ struct Color {
101
+
102
+ union {
103
+ struct {
104
+ u16 r: 4 , g: 4 , b: 4 , a: 4 ;
105
+ } PACKED;
106
+ u16 rgba;
107
+ };
108
+
109
+ constexpr inline Color (u16 raw): rgba(raw) {}
110
+ constexpr inline Color (u8 r, u8 g, u8 b, u8 a): r(r), g(g), b(b), a(a) {}
111
+ };
112
+
97
113
namespace style {
98
- constexpr u32 ListItemDefaultHeight = 70 ; // /< Standard list item height
99
- constexpr u32 TrackBarDefaultHeight = 90 ; // /< Standard track bar height
100
- constexpr u8 ListItemHighlightSaturation = 0x6 ; // /< Maximum saturation of Listitem highlights
101
- constexpr u8 ListItemHighlightLength = 22 ; // /< Maximum length of Listitem highlights
114
+ constexpr u32 ListItemDefaultHeight = 70 ; // /< Standard list item height
115
+ constexpr u32 TrackBarDefaultHeight = 90 ; // /< Standard track bar height
116
+ constexpr u8 ListItemHighlightSaturation = 6 ; // /< Maximum saturation of Listitem highlights
117
+ constexpr u8 ListItemHighlightLength = 22 ; // /< Maximum length of Listitem highlights
102
118
103
119
namespace color {
104
- constexpr u16 ColorFrameBackground = 0xD000 ; // /< Overlay frame background color
105
- constexpr u16 ColorTransparent = 0x0000 ; // /< Transparent color
106
- constexpr u16 ColorHighlight = 0xFDF0 ; // /< Greenish highlight color
107
- constexpr u16 ColorFrame = 0xF777 ; // /< Outer boarder color
108
- constexpr u16 ColorHandle = 0xF555 ; // /< Track bar handle color
109
- constexpr u16 ColorText = 0xFFFF ; // /< Standard text color
110
- constexpr u16 ColorDescription = 0xFAAA ; // /< Description text color
111
- constexpr u16 ColorHeaderBar = 0xFCCC ; // /< Category header rectangle color
112
- constexpr u16 ColorClickAnimation = 0xF220 ;
120
+ constexpr Color ColorFrameBackground = { 0x0 , 0x0 , 0x0 , 0xD } ; // /< Overlay frame background color
121
+ constexpr Color ColorTransparent = { 0x0 , 0x0 , 0x0 , 0x0 } ; // /< Transparent color
122
+ constexpr Color ColorHighlight = { 0x0 , 0xF , 0xD , 0xF } ; // /< Greenish highlight color
123
+ constexpr Color ColorFrame = { 0x7 , 0x7 , 0x7 , 0xF } ; // /< Outer boarder color
124
+ constexpr Color ColorHandle = { 0x5 , 0x5 , 0x5 , 0xF } ; // /< Track bar handle color
125
+ constexpr Color ColorText = { 0xF , 0xF , 0xF , 0xF } ; // /< Standard text color
126
+ constexpr Color ColorDescription = { 0xA , 0xA , 0xA , 0xF } ; // /< Description text color
127
+ constexpr Color ColorHeaderBar = { 0xC , 0xC , 0xC , 0xF } ; // /< Category header rectangle color
128
+ constexpr Color ColorClickAnimation = { 0x0 , 0x2 , 0x2 , 0xF }; // /< Element click animation color
113
129
}
114
130
}
115
131
@@ -528,22 +544,6 @@ namespace tsl {
528
544
529
545
extern " C" u64 __nx_vi_layer_id;
530
546
531
- /* *
532
- * @brief RGBA4444 Color structure
533
- */
534
- struct Color {
535
-
536
- union {
537
- struct {
538
- u16 r: 4 , g: 4 , b: 4 , a: 4 ;
539
- } PACKED;
540
- u16 rgba;
541
- };
542
-
543
- inline Color (u16 raw): rgba(raw) {}
544
- inline Color (u8 r, u8 g, u8 b, u8 a): r(r), g(g), b(b), a(a) {}
545
- };
546
-
547
547
struct ScissoringConfig {
548
548
s32 x, y, w, h;
549
549
};
@@ -1317,7 +1317,7 @@ namespace tsl {
1317
1317
* @param renderer Renderer
1318
1318
*/
1319
1319
virtual void drawClickAnimation (gfx::Renderer *renderer) {
1320
- gfx:: Color animColor = tsl::style::color::ColorClickAnimation;
1320
+ Color animColor = tsl::style::color::ColorClickAnimation;
1321
1321
u8 saturation = tsl::style::ListItemHighlightSaturation * (float (this ->m_clickAnimationProgress ) / float (tsl::style::ListItemHighlightLength));
1322
1322
1323
1323
animColor.g = saturation;
@@ -1350,7 +1350,7 @@ namespace tsl {
1350
1350
virtual void drawHighlight (gfx::Renderer *renderer) {
1351
1351
static float counter = 0 ;
1352
1352
const float progress = (std::sin (counter) + 1 ) / 2 ;
1353
- gfx:: Color highlightColor = { static_cast <u8 >((0x2 - 0x8 ) * progress + 0x8 ),
1353
+ Color highlightColor = { static_cast <u8 >((0x2 - 0x8 ) * progress + 0x8 ),
1354
1354
static_cast <u8 >((0x8 - 0xF ) * progress + 0xF ),
1355
1355
static_cast <u8 >((0xC - 0xF ) * progress + 0xF ),
1356
1356
0xF };
@@ -1768,7 +1768,7 @@ namespace tsl {
1768
1768
*
1769
1769
* @param color Color of the rectangle
1770
1770
*/
1771
- DebugRectangle (gfx:: Color color) : Element(), m_color(color) {}
1771
+ DebugRectangle (Color color) : Element(), m_color(color) {}
1772
1772
virtual ~DebugRectangle () {}
1773
1773
1774
1774
virtual void draw (gfx::Renderer *renderer) override {
@@ -1778,7 +1778,7 @@ namespace tsl {
1778
1778
virtual void layout (u16 parentX, u16 parentY, u16 parentWidth, u16 parentHeight) override {}
1779
1779
1780
1780
private:
1781
- gfx:: Color m_color;
1781
+ Color m_color;
1782
1782
};
1783
1783
1784
1784
@@ -2492,7 +2492,7 @@ namespace tsl {
2492
2492
virtual void drawHighlight (gfx::Renderer *renderer) override {
2493
2493
static float counter = 0 ;
2494
2494
const float progress = (std::sin (counter) + 1 ) / 2 ;
2495
- gfx:: Color highlightColor = { static_cast <u8 >((0x2 - 0x8 ) * progress + 0x8 ),
2495
+ Color highlightColor = { static_cast <u8 >((0x2 - 0x8 ) * progress + 0x8 ),
2496
2496
static_cast <u8 >((0x8 - 0xF ) * progress + 0xF ),
2497
2497
static_cast <u8 >((0xC - 0xF ) * progress + 0xF ),
2498
2498
static_cast <u8 >((0x6 - 0xD ) * progress + 0xD ) };
0 commit comments