RetroArch
ozone_theme.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2011-2018 - Daniel De Matteis
3  * Copyright (C) 2018 - natinusala
4  *
5  * RetroArch is free software: you can redistribute it and/or modify it under the terms
6  * of the GNU General Public License as published by the Free Software Found-
7  * ation, either version 3 of the License, or (at your option) any later version.
8  *
9  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  * PURPOSE. See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with RetroArch.
14  * If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef _OZONE_THEME_H
18 #define _OZONE_THEME_H
19 
20 #include "ozone.h"
21 #include "ozone_texture.h"
22 
23 #include "../../../retroarch.h"
24 
25 #define HEX_R(hex) ((hex >> 16) & 0xFF) * (1.0f / 255.0f)
26 #define HEX_G(hex) ((hex >> 8 ) & 0xFF) * (1.0f / 255.0f)
27 #define HEX_B(hex) ((hex >> 0 ) & 0xFF) * (1.0f / 255.0f)
28 
29 #define COLOR_HEX_TO_FLOAT(hex, alpha) { \
30  HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
31  HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
32  HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
33  HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha \
34 }
35 
36 #define COLOR_TEXT_ALPHA(color, alpha) (color & 0xFFFFFF00) | alpha
37 
38 static float ozone_pure_white[16] = {
39  1.00, 1.00, 1.00, 1.00,
40  1.00, 1.00, 1.00, 1.00,
41  1.00, 1.00, 1.00, 1.00,
42  1.00, 1.00, 1.00, 1.00,
43 };
44 
45 static float ozone_backdrop[16] = {
46  0.00, 0.00, 0.00, 0.75,
47  0.00, 0.00, 0.00, 0.75,
48  0.00, 0.00, 0.00, 0.75,
49  0.00, 0.00, 0.00, 0.75,
50 };
51 
52 static float ozone_osk_backdrop[16] = {
53  0.00, 0.00, 0.00, 0.15,
54  0.00, 0.00, 0.00, 0.15,
55  0.00, 0.00, 0.00, 0.15,
56  0.00, 0.00, 0.00, 0.15,
57 };
58 
59 static float ozone_sidebar_background_light[16] = {
60  0.94, 0.94, 0.94, 1.00,
61  0.94, 0.94, 0.94, 1.00,
62  0.94, 0.94, 0.94, 1.00,
63  0.94, 0.94, 0.94, 1.00,
64 };
65 
67  0.94, 0.94, 0.94, 1.00,
68  0.94, 0.94, 0.94, 1.00,
69  0.922, 0.922, 0.922, 1.00,
70  0.922, 0.922, 0.922, 1.00,
71 };
72 
74  0.922, 0.922, 0.922, 1.00,
75  0.922, 0.922, 0.922, 1.00,
76  0.94, 0.94, 0.94, 1.00,
77  0.94, 0.94, 0.94, 1.00,
78 };
79 
80 static float ozone_sidebar_background_dark[16] = {
81  0.2, 0.2, 0.2, 1.00,
82  0.2, 0.2, 0.2, 1.00,
83  0.2, 0.2, 0.2, 1.00,
84  0.2, 0.2, 0.2, 1.00,
85 };
86 
87 static float ozone_sidebar_gradient_top_dark[16] = {
88  0.2, 0.2, 0.2, 1.00,
89  0.2, 0.2, 0.2, 1.00,
90  0.18, 0.18, 0.18, 1.00,
91  0.18, 0.18, 0.18, 1.00,
92 };
93 
95  0.18, 0.18, 0.18, 1.00,
96  0.18, 0.18, 0.18, 1.00,
97  0.2, 0.2, 0.2, 1.00,
98  0.2, 0.2, 0.2, 1.00,
99 };
100 
101 static float ozone_border_0_light[16] = COLOR_HEX_TO_FLOAT(0x50EFD9, 1.00);
102 static float ozone_border_1_light[16] = COLOR_HEX_TO_FLOAT(0x0DB6D5, 1.00);
103 
104 static float ozone_border_0_dark[16] = COLOR_HEX_TO_FLOAT(0x198AC6, 1.00);
105 static float ozone_border_1_dark[16] = COLOR_HEX_TO_FLOAT(0x89F1F2, 1.00);
106 
108  0.690, 0.690, 0.690, 0.75,
109  0.690, 0.690, 0.690, 0.75,
110  0.922, 0.922, 0.922, 1.0,
111  0.922, 0.922, 0.922, 1.0
112 };
113 
115  0.176, 0.176, 0.176, 0.75,
116  0.176, 0.176, 0.176, 0.75,
117  0.178, 0.178, 0.178, 1.0,
118  0.178, 0.178, 0.178, 1.0,
119 };
120 
121 typedef struct ozone_theme
122 {
123  /* Background color */
124  float background[16];
126 
127  /* Float colors for quads and icons */
129  float text[16];
130  float selection[16];
131  float selection_border[16];
132  float entries_border[16];
133  float entries_icon[16];
134  float text_selected[16];
136 
137  /* RGBA colors for text */
141 
142  /* Sidebar color */
146 
147  /*
148  Fancy cursor colors
149  */
152 
154 
155  const char *name;
156 } ozone_theme_t;
157 
160 
161 extern ozone_theme_t *ozone_themes[];
162 
163 extern unsigned ozone_themes_count;
164 extern unsigned last_color_theme;
167 
168 void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme);
169 unsigned ozone_get_system_theme();
170 
171 #endif
static float ozone_border_1_dark[16]
Definition: ozone_theme.h:105
void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme)
Definition: ozone_theme.c:89
float * sidebar_background
Definition: ozone_theme.h:143
float selection[16]
Definition: ozone_theme.h:130
ozone_theme_t ozone_theme_dark
Definition: ozone_theme.c:50
static float ozone_sidebar_gradient_bottom_dark[16]
Definition: ozone_theme.h:94
static float ozone_backdrop[16]
Definition: ozone_theme.h:45
static float ozone_border_0_light[16]
Definition: ozone_theme.h:101
float message_background[16]
Definition: ozone_theme.h:135
uint32_t text_selected_rgba
Definition: ozone_theme.h:139
ozone_theme_t ozone_theme_light
Definition: ozone_theme.c:21
ozone_theme_t * ozone_themes[]
Definition: ozone_theme.c:79
uintptr_t menu_texture_item
Definition: menu_driver.h:348
ozone_theme_t * ozone_default_theme
Definition: ozone_theme.c:87
static float ozone_osk_backdrop[16]
Definition: ozone_theme.h:52
float * sidebar_top_gradient
Definition: ozone_theme.h:144
static float ozone_background_libretro_running_dark[16]
Definition: ozone_theme.h:114
static float ozone_sidebar_gradient_bottom_light[16]
Definition: ozone_theme.h:73
Definition: ozone_theme.h:121
static float ozone_sidebar_background_light[16]
Definition: ozone_theme.h:59
float * sidebar_bottom_gradient
Definition: ozone_theme.h:145
unsigned last_color_theme
Definition: ozone_theme.c:85
const char * name
Definition: ozone_theme.h:155
static float ozone_border_0_dark[16]
Definition: ozone_theme.h:104
uint32_t text_rgba
Definition: ozone_theme.h:138
static float ozone_sidebar_background_dark[16]
Definition: ozone_theme.h:80
struct ozone_theme ozone_theme_t
static float ozone_pure_white[16]
Definition: ozone_theme.h:38
Definition: ozone.h:45
float selection_border[16]
Definition: ozone_theme.h:131
static float ozone_background_libretro_running_light[16]
Definition: ozone_theme.h:107
#define COLOR_HEX_TO_FLOAT(hex, alpha)
Definition: ozone_theme.h:29
static float ozone_sidebar_gradient_top_dark[16]
Definition: ozone_theme.h:87
float entries_icon[16]
Definition: ozone_theme.h:133
Definition: ozone_texture.h:49
const GLuint * textures
Definition: glext.h:9001
float * cursor_border_0
Definition: ozone_theme.h:150
float * background_libretro_running
Definition: ozone_theme.h:125
float background[16]
Definition: ozone_theme.h:124
float text[16]
Definition: ozone_theme.h:129
float header_footer_separator[16]
Definition: ozone_theme.h:128
float entries_border[16]
Definition: ozone_theme.h:132
unsigned ozone_themes_count
Definition: ozone_theme.c:84
bool last_use_preferred_system_color_theme
Definition: ozone_theme.c:86
uint32_t text_sublabel_rgba
Definition: ozone_theme.h:140
float * cursor_border_1
Definition: ozone_theme.h:151
static float ozone_sidebar_gradient_top_light[16]
Definition: ozone_theme.h:66
static float ozone_border_1_light[16]
Definition: ozone_theme.h:102
float text_selected[16]
Definition: ozone_theme.h:134
unsigned int uint32_t
Definition: stdint.h:126
unsigned ozone_get_system_theme()
Definition: ozone_theme.c:121