libxputty 0.1
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
xcolor.h File Reference

Go to the source code of this file.

Data Structures

struct  Colors
 Color_t - struct used to set cairo color for Widget_t. More...
 
struct  XColor_t
 XColor_t - the Widget_t Color struct XColor_t could be used for theming you Widget_t set. More...
 
struct  SystrayColor_t
 SystrayColor - the Systray Color struct SystrayColor could be used for the backgroung color of the SystrayIcon. More...
 

Enumerations

enum  Color_state {
  NORMAL_ , PRELIGHT_ , SELECTED_ , ACTIVE_ ,
  INSENSITIVE_
}
 Color_state - select color mode to use on Widget_t. More...
 
enum  Color_mod {
  FORGROUND_ , BACKGROUND_ , BASE_ , TEXT_ ,
  SHADOW_ , FRAME_ , LIGHT_
}
 Color_mod - select color mod to use on draw. More...
 

Functions

void set_dark_theme (Xputty *main)
 set_dark_theme - init the XColor_t struct to the default dark theme
 
void set_light_theme (Xputty *main)
 set_light_theme - init the XColor_t struct to the default light theme
 
void color_scheme_to_childs (Widget_t *wid)
 color_scheme_to_childs - copy a colorscheme to all childs light theme
 
void set_widget_color (Widget_t *w, Color_state st, Color_mod mod, double r, double g, double b, double a)
 set_widget_color - set a individual Widget_t color
 
void widget_set_color (double *c, double r, double g, double b, double a)
 widget_set_color - set a individual Widget_t color
 
Colorsget_color_scheme (Widget_t *wid, Color_state st)
 get_color_scheme - get pointer to the Colors struct to use in relation to the Color_state
 
Color_state get_color_state (Widget_t *wid)
 get_color_state - get the Color_state to use in relation to the Widget_t state
 
void use_fg_color_scheme (Widget_t *w, Color_state st)
 use_fg_color_scheme - use forground Colors to paint on Widget_t
 
void use_bg_color_scheme (Widget_t *w, Color_state st)
 use_bg_color_scheme - use background Colors to paint on Widget_t
 
void use_base_color_scheme (Widget_t *w, Color_state st)
 use_base_color_scheme - use base Colors to paint on Widget_t
 
void use_text_color_scheme (Widget_t *w, Color_state st)
 use_text_color_scheme - use text Colors to paint on Widget_t
 
void use_shadow_color_scheme (Widget_t *w, Color_state st)
 use_shadow_color_scheme - use shadow Colors to paint on Widget_t
 
void use_frame_color_scheme (Widget_t *w, Color_state st)
 use_frame_color_scheme - use frame Colors to paint on Widget_t
 
void use_light_color_scheme (Widget_t *w, Color_state st)
 use_light_color_scheme - use light Colors to paint on Widget_t
 
void use_systray_color (Widget_t *w)
 use_systray_color - use systray Colors to paint on Widget_t
 
void set_systray_color (Xputty *main, double r, double g, double b, double a)
 set_systray_color - set the systray background color
 
void set_pattern (Widget_t *w, Colors *from, Colors *to, Color_mod mod)
 set_pattern - set pattern for the selected Colors
 

Enumeration Type Documentation

◆ Color_mod

enum Color_mod

Color_mod - select color mod to use on draw.

Parameters
FORGROUND_- use the foreground color set
BACKGROUND_- use the background color set
BASE_- use the base color set
TEXT_- use the text color set
SHADOW_- use the shadow color set
FRAME_- use the frame color set
LIGHT_- use the light color set
Enumerator
FORGROUND_ 
BACKGROUND_ 
BASE_ 
TEXT_ 
SHADOW_ 
FRAME_ 
LIGHT_ 

Definition at line 63 of file xcolor.h.

63 {
66 BASE_,
67 TEXT_,
68 SHADOW_,
69 FRAME_,
70 LIGHT_,
71} Color_mod;
Color_mod
Color_mod - select color mod to use on draw.
Definition xcolor.h:63
@ BASE_
Definition xcolor.h:66
@ SHADOW_
Definition xcolor.h:68
@ FRAME_
Definition xcolor.h:69
@ FORGROUND_
Definition xcolor.h:64
@ BACKGROUND_
Definition xcolor.h:65
@ TEXT_
Definition xcolor.h:67
@ LIGHT_
Definition xcolor.h:70

◆ Color_state

Color_state - select color mode to use on Widget_t.

Parameters
NORMAL_- normal state
PRELIGHT_- prelight state (mouse is hover)
SELECTED_- selected state
ACTIVE_- active state (mouse is pressed)
INSENSITIVE_- Widget_t can't react on mouse/key input
Enumerator
NORMAL_ 
PRELIGHT_ 
SELECTED_ 
ACTIVE_ 
INSENSITIVE_ 

Definition at line 43 of file xcolor.h.

43 {
44 NORMAL_,
47 ACTIVE_,
Color_state
Color_state - select color mode to use on Widget_t.
Definition xcolor.h:43
@ NORMAL_
Definition xcolor.h:44
@ INSENSITIVE_
Definition xcolor.h:48
@ SELECTED_
Definition xcolor.h:46
@ PRELIGHT_
Definition xcolor.h:45
@ ACTIVE_
Definition xcolor.h:47

Function Documentation

◆ color_scheme_to_childs()

void color_scheme_to_childs ( Widget_t wid)

color_scheme_to_childs - copy a colorscheme to all childs light theme

Parameters
*wid- pointer to the Widget_t take the colorscheme from

Definition at line 130 of file xcolor.c.

130 {
131 int i=0;
132 for(;i<wid->childlist->elem;i++) {
133 Widget_t* w = wid->childlist->childs[i];
134 memcpy(w->color_scheme, wid->color_scheme, sizeof (struct XColor_t));
136 }
137}
Widget_t ** childs
Definition xchildlist.h:51
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
XColor_t * color_scheme
Definition xwidget.h:467
Childlist_t * childlist
Definition xwidget.h:499
XColor_t - the Widget_t Color struct XColor_t could be used for theming you Widget_t set.
Definition xcolor.h:105
void color_scheme_to_childs(Widget_t *wid)
color_scheme_to_childs - copy a colorscheme to all childs light theme
Definition xcolor.c:130

References Widget_t::childlist, Childlist_t::childs, Widget_t::color_scheme, color_scheme_to_childs(), and Childlist_t::elem.

Referenced by color_scheme_to_childs().

◆ get_color_scheme()

Colors * get_color_scheme ( Widget_t wid,
Color_state  st 
)

get_color_scheme - get pointer to the Colors struct to use in relation to the Color_state

Parameters
*wid- pointer to the Widget_t
*st- the Color state to use
Returns
*Colors - pointer to the Widget_t Colors struct

Definition at line 197 of file xcolor.c.

197 {
198 switch(st) {
199 case NORMAL_:
200 return &wid->color_scheme->normal;
201 break;
202 case PRELIGHT_:
203 return &wid->color_scheme->prelight;
204 break;
205 case SELECTED_:
206 return &wid->color_scheme->selected;
207 break;
208 case ACTIVE_:
209 return &wid->color_scheme->active;
210 break;
211 case INSENSITIVE_:
212 return &wid->color_scheme->insensitive;
213 break;
214 default:
215 return &wid->color_scheme->normal;
216 break;
217 }
218 return NULL;
219
220}
Colors normal
Definition xcolor.h:106
Colors insensitive
Definition xcolor.h:110
Colors selected
Definition xcolor.h:108
Colors active
Definition xcolor.h:109
Colors prelight
Definition xcolor.h:107

References XColor_t::active, ACTIVE_, Widget_t::color_scheme, XColor_t::insensitive, INSENSITIVE_, XColor_t::normal, NORMAL_, XColor_t::prelight, PRELIGHT_, XColor_t::selected, and SELECTED_.

Referenced by _create_playhead_image(), _pattern_hslider(), _pattern_in(), _pattern_out(), _pattern_vslider(), set_widget_color(), use_base_color_scheme(), use_bg_color_scheme(), use_fg_color_scheme(), use_frame_color_scheme(), use_light_color_scheme(), use_shadow_color_scheme(), and use_text_color_scheme().

◆ get_color_state()

Color_state get_color_state ( Widget_t wid)

get_color_state - get the Color_state to use in relation to the Widget_t state

Parameters
*wid- pointer to the Widget_t
Returns
Color_state - the Color_state related to the Widget_t state
Examples
simple-example.c.

Definition at line 222 of file xcolor.c.

222 {
223 switch(wid->state) {
224 case 0:
225 return NORMAL_;
226 break;
227 case 1:
228 return PRELIGHT_;
229 break;
230 case 2:
231 return SELECTED_;
232 break;
233 case 3:
234 return ACTIVE_;
235 break;
236 case 4:
237 return INSENSITIVE_;
238 break;
239 default:
240 return NORMAL_;
241 break;
242 }
243}
int state
Definition xwidget.h:511

References ACTIVE_, INSENSITIVE_, NORMAL_, PRELIGHT_, SELECTED_, and Widget_t::state.

Referenced by _draw_accel_check_item(), _draw_accel_item(), _draw_base_button(), _draw_buttons(), _draw_check_box(), _draw_check_button(), _draw_check_item(), _draw_combobox(), _draw_combobox_button(), _draw_combobox_menu_slider(), _draw_frame(), _draw_hslider(), _draw_image(), _draw_image_button_with_label(), _draw_item(), _draw_knob(), _draw_label(), _draw_listbox_item(), _draw_listviewslider(), _draw_menu(), _draw_menu_label(), _draw_menu_slider(), _draw_multi_listviewslider(), _draw_on_off_button(), _draw_spinbox(), _draw_submenu(), _draw_tabbox(), _draw_tooltip(), _draw_value_item(), _draw_valuedisplay(), _draw_vslider(), _draw_waveview(), draw_hyperlink(), and mk_draw_knob().

◆ set_dark_theme()

void set_dark_theme ( Xputty main)

set_dark_theme - init the XColor_t struct to the default dark theme

Parameters
*main- pointer to the main Xputty struct

Definition at line 24 of file xcolor.c.

24 {
25 main->color_scheme->normal = (Colors) {
26 /* cairo / r / g / b / a / */
27 .fg = { 0.85, 0.85, 0.85, 1.0},
28 .bg = { 0.1, 0.1, 0.1, 1.0},
29 .base = { 0.0, 0.0, 0.0, 1.0},
30 .text = { 0.9, 0.9, 0.9, 1.0},
31 .shadow = { 0.0, 0.0, 0.0, 0.2},
32 .frame = { 0.0, 0.0, 0.0, 1.0},
33 .light = { 0.1, 0.1, 0.1, 1.0}
34 };
35
36 main->color_scheme->prelight = (Colors) {
37 .fg = { 1.0, 0.0, 1.0, 1.0},
38 .bg = { 0.25, 0.25, 0.25, 1.0},
39 .base = { 0.3, 0.3, 0.3, 1.0},
40 .text = { 1.0, 1.0, 1.0, 1.0},
41 .shadow = { 0.1, 0.1, 0.1, 0.4},
42 .frame = { 0.3, 0.3, 0.3, 1.0},
43 .light = { 0.3, 0.3, 0.3, 1.0}
44 };
45
46 main->color_scheme->selected = (Colors) {
47 .fg = { 0.9, 0.9, 0.9, 1.0},
48 .bg = { 0.2, 0.2, 0.2, 1.0},
49 .base = { 0.5, 0.18, 0.18, 1.0},
50 .text = { 1.0, 1.0, 1.0, 1.0},
51 .shadow = { 0.8, 0.18, 0.18, 0.2},
52 .frame = { 0.5, 0.18, 0.18, 1.0},
53 .light = { 0.5, 0.18, 0.18, 1.0}
54 };
55
56 main->color_scheme->active = (Colors) {
57 .fg = { 0.0, 1.0, 1.0, 1.0},
58 .bg = { 0.0, 0.0, 0.0, 1.0},
59 .base = { 0.18, 0.38, 0.38, 1.0},
60 .text = { 0.75, 0.75, 0.75, 1.0},
61 .shadow = { 0.18, 0.38, 0.38, 0.5},
62 .frame = { 0.18, 0.38, 0.38, 1.0},
63 .light = { 0.18, 0.38, 0.38, 1.0}
64 };
65
67 .fg = { 0.85, 0.85, 0.85, 0.5},
68 .bg = { 0.1, 0.1, 0.1, 0.5},
69 .base = { 0.0, 0.0, 0.0, 0.5},
70 .text = { 0.9, 0.9, 0.9, 0.5},
71 .shadow = { 0.0, 0.0, 0.0, 0.1},
72 .frame = { 0.0, 0.0, 0.0, 0.5},
73 .light = { 0.1, 0.1, 0.1, 0.5}
74 };
75}
Color_t - struct used to set cairo color for Widget_t.
Definition xcolor.h:85
double fg[4]
Definition xcolor.h:86
XColor_t * color_scheme
Definition xputty.h:234

References XColor_t::active, Xputty::color_scheme, Colors::fg, XColor_t::insensitive, XColor_t::normal, XColor_t::prelight, and XColor_t::selected.

Referenced by main_init().

◆ set_light_theme()

void set_light_theme ( Xputty main)

set_light_theme - init the XColor_t struct to the default light theme

Parameters
*main- pointer to the main Xputty struct

Definition at line 77 of file xcolor.c.

77 {
78 main->color_scheme->normal = (Colors) {
79 /* cairo / r / g / b / a / */
80 .fg = { 0.15, 0.15, 0.15, 1.0},
81 .bg = { 0.85, 0.85, 0.85, 1.0},
82 .base = { 0.9, 0.9, 0.9, 1.0},
83 .text = { 0.25, 0.25, 0.25, 1.0},
84 .shadow = { 0.0, 0.0, 0.0, 0.2},
85 .frame = { 0.2, 0.2, 0.2, 1.0},
86 .light = { 0.9, 0.9, 0.9, 1.0}
87 };
88
89 main->color_scheme->prelight = (Colors) {
90 .fg = { 0.25, 0.25, 0.25, 1.0},
91 .bg = { 1.0, 1.0, 1.0, 1.0},
92 .base = { 0.75, 0.75, 0.75, 1.0},
93 .text = { 0.15, 0.15, 0.15, 1.0},
94 .shadow = { 0.1, 0.1, 0.1, 0.4},
95 .frame = { 0.3, 0.3, 0.3, 1.0},
96 .light = { 0.75, 0.75, 0.75, 1.0}
97 };
98
99 main->color_scheme->selected = (Colors) {
100 .fg = { 0.2, 0.2, 0.2, 1.0},
101 .bg = { 0.9, 0.9, 0.9, 1.0},
102 .base = { 0.0, 0.5, 0.65, 1.0},
103 .text = { 0.8, 0.8, 0.8, 1.0},
104 .shadow = { 0.8, 0.18, 0.18, 0.2},
105 .frame = { 0.5, 0.18, 0.18, 1.0},
106 .light = { 0.5, 0.5, 0.5, 1.0}
107 };
108
109 main->color_scheme->active = (Colors) {
110 .fg = { 0.0, 0.0, 0.0, 1.0},
111 .bg = { 1.0, 1.0, 1.0, 1.0},
112 .base = { 0.0, 0.3, 0.65, 1.0},
113 .text = { 0.8, 0.8, 0.8, 1.0},
114 .shadow = { 0.18, 0.38, 0.38, 0.5},
115 .frame = { 0.18, 0.38, 0.38, 1.0},
116 .light = { 0.3, 0.3, 0.3, 1.0}
117 };
118
119 main->color_scheme->insensitive = (Colors) {
120 .fg = { 0.15, 0.15, 0.15, 0.5},
121 .bg = { 0.85, 0.85, 0.85, 0.5},
122 .base = { 0.9, 0.9, 0.9, 0.5},
123 .text = { 0.25, 0.25, 0.25, 0.5},
124 .shadow = { 0.0, 0.0, 0.0, 0.1},
125 .frame = { 0.2, 0.2, 0.2, 0.5},
126 .light = { 0.9, 0.9, 0.9, 0.5}
127 };
128}

References XColor_t::active, Xputty::color_scheme, Colors::fg, XColor_t::insensitive, XColor_t::normal, XColor_t::prelight, and XColor_t::selected.

◆ set_pattern()

void set_pattern ( Widget_t w,
Colors from,
Colors to,
Color_mod  mod 
)

set_pattern - set pattern for the selected Colors

Parameters
*w- pointer to the Widget_t to set the pattern
*from- the Colors set to pattern from (0)
*to- the Colors set to pattern to (1)
mod- the Color_mod to use

Definition at line 308 of file xcolor.c.

308 {
309 double *col_from = NULL;
310 double *col_to = NULL;
311 switch (mod) {
312 case FORGROUND_:
313 col_from = from->fg;
314 col_to = to->fg;
315 break;
316 case BACKGROUND_:
317 col_from = from->bg;
318 col_to = to->bg;
319 break;
320 case BASE_:
321 col_from = from->base;
322 col_to = to->base;
323 break;
324 case TEXT_:
325 col_from = from->text;
326 col_to = to->text;
327 break;
328 case SHADOW_:
329 col_from = from->shadow;
330 col_to = to->shadow;
331 break;
332 case FRAME_:
333 col_from = from->frame;
334 col_to = to->frame;
335 break;
336 case LIGHT_:
337 col_from = from->light;
338 col_to = to->light;
339 break;
340 }
341 Metrics_t metrics;
342 os_get_window_metrics(w, &metrics);
343 int width = metrics.width;
344 int height = metrics.height;
345 cairo_pattern_t *pat = cairo_pattern_create_linear (0, 0, width, height);
346 cairo_pattern_add_color_stop_rgba(pat, 0.0, col_from[0], col_from[1], col_from[2], col_from[3]);
347 cairo_pattern_add_color_stop_rgba(pat, 1.0, col_to[0], col_to[1], col_to[2], col_to[3]);
348 cairo_set_source(w->crb, pat);
349 cairo_set_source(w->cr, pat);
350 cairo_pattern_destroy (pat);
351}
double text[4]
Definition xcolor.h:89
double frame[4]
Definition xcolor.h:91
double shadow[4]
Definition xcolor.h:90
double base[4]
Definition xcolor.h:88
double bg[4]
Definition xcolor.h:87
double light[4]
Definition xcolor.h:92
Metrics_t - struct to receive window size, position & visibility Pass this struct to os_get_window_...
cairo_t * crb
Definition xwidget.h:489
cairo_t * cr
Definition xwidget.h:485
void os_get_window_metrics(Widget_t *w, Metrics_t *metrics)
os_get_window_metrics - Get the Merics_t struct related to a Widget_t

References BACKGROUND_, Colors::base, BASE_, Colors::bg, Widget_t::cr, Widget_t::crb, Colors::fg, FORGROUND_, Colors::frame, FRAME_, Metrics_t::height, Colors::light, LIGHT_, os_get_window_metrics(), Colors::shadow, SHADOW_, Colors::text, TEXT_, and Metrics_t::width.

Referenced by _draw_combobox_menu(), _draw_listview(), and _draw_multi_listview().

◆ set_systray_color()

void set_systray_color ( Xputty main,
double  r,
double  g,
double  b,
double  a 
)

set_systray_color - set the systray background color

Parameters
main- pointer to the main Xputty struct
r- the red Color to use
g- the green Color to use
b- the blue Color to use
a- the alpha Cannel to use

Definition at line 300 of file xcolor.c.

300 {
301 SystrayColor_t *c = main->systray_color;
302 c->r = r;
303 c->g = g;
304 c->b = b;
305 c->a = a;
306}
SystrayColor - the Systray Color struct SystrayColor could be used for the backgroung color of the Sy...
Definition xcolor.h:122
SystrayColor_t * systray_color
Definition xputty.h:236

References SystrayColor_t::a, SystrayColor_t::b, SystrayColor_t::g, SystrayColor_t::r, and Xputty::systray_color.

Referenced by main_init(), and os_send_systray_message().

◆ set_widget_color()

void set_widget_color ( Widget_t w,
Color_state  st,
Color_mod  mod,
double  r,
double  g,
double  b,
double  a 
)

set_widget_color - set a individual Widget_t color

Parameters
*w- the Widget_t the color belong to
st- the state the color belong to
*mod- the Color mod to set
r- the red color
g- the green color
b- the blue color
a- the alpha channel

Definition at line 146 of file xcolor.c.

147 {
148 Colors *c = get_color_scheme(w, st);
149 switch(mod) {
150 case FORGROUND_:
151 c->fg[0] = r;
152 c->fg[1] = g;
153 c->fg[2] = b;
154 c->fg[3] = a;
155 break;
156 case BACKGROUND_:
157 c->bg[0] = r;
158 c->bg[1] = g;
159 c->bg[2] = b;
160 c->bg[3] = a;
161 break;
162 case BASE_:
163 c->base[0] = r;
164 c->base[1] = g;
165 c->base[2] = b;
166 c->base[3] = a;
167 break;
168 case TEXT_:
169 c->text[0] = r;
170 c->text[1] = g;
171 c->text[2] = b;
172 c->text[3] = a;
173 break;
174 case SHADOW_:
175 c->shadow[0] = r;
176 c->shadow[1] = g;
177 c->shadow[2] = b;
178 c->shadow[3] = a;
179 break;
180 case FRAME_:
181 c->frame[0] = r;
182 c->frame[1] = g;
183 c->frame[2] = b;
184 c->frame[3] = a;
185 break;
186 case LIGHT_:
187 c->light[0] = r;
188 c->light[1] = g;
189 c->light[2] = b;
190 c->light[3] = a;
191 break;
192 default:
193 break;
194 }
195}
Colors * get_color_scheme(Widget_t *wid, Color_state st)
get_color_scheme - get pointer to the Colors struct to use in relation to the Color_state
Definition xcolor.c:197

References BACKGROUND_, Colors::base, BASE_, Colors::bg, Colors::fg, FORGROUND_, Colors::frame, FRAME_, get_color_scheme(), Colors::light, LIGHT_, Colors::shadow, SHADOW_, Colors::text, and TEXT_.

◆ use_base_color_scheme()

void use_base_color_scheme ( Widget_t w,
Color_state  st 
)

use_base_color_scheme - use base Colors to paint on Widget_t

Parameters
w- the Widget_t to set the Colors
st- the Color_state to use

Definition at line 259 of file xcolor.c.

259 {
260 Colors *c = get_color_scheme(w, st);
261 if (!c) return;
262 cairo_set_source_rgba(w->cr, c->base[0], c->base[1], c->base[2], c->base[3]);
263 cairo_set_source_rgba(w->crb, c->base[0], c->base[1], c->base[2], c->base[3]);
264}

References Colors::base, Widget_t::cr, Widget_t::crb, and get_color_scheme().

Referenced by _draw_accel_item(), _draw_combobox_entrys(), _draw_image(), _draw_item(), _draw_list(), _draw_listbox_item(), _draw_listbox_viewslider(), _draw_multi_list(), _draw_submenu(), _draw_value_item(), _update_list_view(), and _update_view().

◆ use_bg_color_scheme()

void use_bg_color_scheme ( Widget_t w,
Color_state  st 
)

use_bg_color_scheme - use background Colors to paint on Widget_t

Parameters
w- the Widget_t to set the Colors
st- the Color_state to use
Examples
simple-example.c.

Definition at line 252 of file xcolor.c.

252 {
253 Colors *c = get_color_scheme(w, st);
254 if (!c) return;
255 cairo_set_source_rgba(w->cr, c->bg[0], c->bg[1], c->bg[2], c->bg[3]);
256 cairo_set_source_rgba(w->crb, c->bg[0], c->bg[1], c->bg[2], c->bg[3]);
257}

References Colors::bg, Widget_t::cr, Widget_t::crb, and get_color_scheme().

Referenced by _draw_buttons(), _draw_combobox_menu_slider(), _draw_hslider(), _draw_knob(), _draw_listbox(), _draw_listbox_viewslider(), _draw_listviewslider(), _draw_menu(), _draw_menu_slider(), _draw_multi_listviewslider(), _draw_spinbox(), _draw_tabbox(), _draw_tooltip(), _draw_tuner(), _draw_vslider(), and _draw_waveview().

◆ use_fg_color_scheme()

void use_fg_color_scheme ( Widget_t w,
Color_state  st 
)

use_fg_color_scheme - use forground Colors to paint on Widget_t

Parameters
*w- the Widget_t to set the Colors
st- the Color_state to use

Definition at line 245 of file xcolor.c.

245 {
246 Colors *c = get_color_scheme(w, st);
247 if (!c) return;
248 cairo_set_source_rgba(w->cr, c->fg[0], c->fg[1], c->fg[2], c->fg[3]);
249 cairo_set_source_rgba(w->crb, c->fg[0], c->fg[1], c->fg[2], c->fg[3]);
250}

References Widget_t::cr, Widget_t::crb, Colors::fg, and get_color_scheme().

Referenced by _draw_accel_check_item(), _draw_check_box(), _draw_check_button(), _draw_check_item(), _draw_combobox_button(), _draw_hslider(), _draw_image_button_with_label(), _draw_knob(), _draw_listbox_viewslider(), _draw_vslider(), _draw_waveview(), and draw_hyperlink().

◆ use_frame_color_scheme()

void use_frame_color_scheme ( Widget_t w,
Color_state  st 
)

use_frame_color_scheme - use frame Colors to paint on Widget_t

Parameters
w- the Widget_t to set the Colors
st- the Color_state to use

Definition at line 280 of file xcolor.c.

280 {
281 Colors *c = get_color_scheme(w, st);
282 if (!c) return;
283 cairo_set_source_rgba(w->cr, c->frame[0], c->frame[1], c->frame[2], c->frame[3]);
284 cairo_set_source_rgba(w->crb, c->frame[0], c->frame[1], c->frame[2], c->frame[3]);
285}

References Widget_t::cr, Widget_t::crb, Colors::frame, and get_color_scheme().

Referenced by _draw_accel_item(), _draw_button_base(), _draw_combobox(), _draw_combobox_button(), _draw_combobox_entrys(), _draw_combobox_menu_slider(), _draw_frame(), _draw_item(), _draw_list(), _draw_listbox_item(), _draw_submenu(), _draw_tabbox(), _draw_value_item(), _draw_valuedisplay(), _draw_waveview(), and _update_list_view().

◆ use_light_color_scheme()

void use_light_color_scheme ( Widget_t w,
Color_state  st 
)

use_light_color_scheme - use light Colors to paint on Widget_t

Parameters
w- the Widget_t to set the Colors
st- the Color_state to use

Definition at line 287 of file xcolor.c.

287 {
288 Colors *c = get_color_scheme(w, st);
289 if (!c) return;
290 cairo_set_source_rgba(w->cr, c->light[0], c->light[1], c->light[2], c->light[3]);
291 cairo_set_source_rgba(w->crb, c->light[0], c->light[1], c->light[2], c->light[3]);
292}

References Widget_t::cr, Widget_t::crb, get_color_scheme(), and Colors::light.

Referenced by _draw_waveview().

◆ use_shadow_color_scheme()

void use_shadow_color_scheme ( Widget_t w,
Color_state  st 
)

use_shadow_color_scheme - use shadow Colors to paint on Widget_t

Parameters
w- the Widget_t to set the Colors
st- the Color_state to use

Definition at line 273 of file xcolor.c.

273 {
274 Colors *c = get_color_scheme(w, st);
275 if (!c) return;
276 cairo_set_source_rgba(w->cr, c->shadow[0], c->shadow[1], c->shadow[2], c->shadow[3]);
277 cairo_set_source_rgba(w->crb, c->shadow[0], c->shadow[1], c->shadow[2], c->shadow[3]);
278}

References Widget_t::cr, Widget_t::crb, get_color_scheme(), and Colors::shadow.

Referenced by _create_horizontal_meter_image(), _create_vertical_meter_image(), _draw_accel_check_item(), _draw_check_item(), _draw_combobox(), _draw_combobox_menu_slider(), _draw_hslider(), _draw_knob(), _draw_listviewslider(), _draw_menu_slider(), _draw_multi_listviewslider(), _draw_valuedisplay(), and _draw_vslider().

◆ use_systray_color()

void use_systray_color ( Widget_t w)

use_systray_color - use systray Colors to paint on Widget_t

Parameters
w- the Widget_t to set the Colors

Definition at line 294 of file xcolor.c.

294 {
296 cairo_set_source_rgba(w->cr, c->r, c->g, c->b, c->a);
297 cairo_set_source_rgba(w->crb, c->r, c->g, c->b, c->a);
298}
Xputty * app
Definition xwidget.h:465

References SystrayColor_t::a, Widget_t::app, SystrayColor_t::b, Widget_t::cr, Widget_t::crb, SystrayColor_t::g, SystrayColor_t::r, and Xputty::systray_color.

◆ use_text_color_scheme()

void use_text_color_scheme ( Widget_t w,
Color_state  st 
)

◆ widget_set_color()

void widget_set_color ( double *  c,
double  r,
double  g,
double  b,
double  a 
)

widget_set_color - set a individual Widget_t color

Parameters
*c- direct pointer to the color array
r- the red color
g- the green color
b- the blue color
a- the alpha channel

Definition at line 139 of file xcolor.c.

139 {
140 c[0] = r;
141 c[1] = g;
142 c[2] = b;
143 c[3] = a;
144}