GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Colors and color scheme. More...
#include <widgets/gp_widget_types.h>
Go to the source code of this file.
Functions | |
enum gp_widgets_color | gp_widgets_color_name_idx (const char *name) |
Converts a color name into a color index. | |
gp_pixel | gp_widgets_color (const gp_widget_render_ctx *ctx, enum gp_widgets_color color) |
Returns a pixel given an color index. | |
void | gp_widgets_color_scheme_toggle (void) |
Toggles current color scheme. | |
void | gp_widgets_color_scheme_set (enum gp_widgets_color_scheme color_scheme) |
Sets a color scheme. | |
enum gp_widgets_color_scheme | gp_widgets_color_scheme_get (void) |
Returns current color scheme. | |
gp_widget * | gp_widget_color_scheme_switch (void) |
Creates a color scheme switch widget. | |
Colors and color scheme.
Color theme provies a mapping from an abstract color names such as text color or background color to indexes into a global color table gp_widget_render_ctx::colors.
Color name | Color definition |
---|---|
"text" | Text color |
"fg" | Foreground color |
"bg | Background color |
"highlight" | Highlighted background |
"alert" | Alert (error) color, usually red |
"warn" | Warning color, usually yellow |
"accept" | Accept color, usually green |
Color names | |||
---|---|---|---|
"black" | "red" | "green" | "yellow" |
"blue" | "magenta" | "cyan" | "gray" |
"bright black" | "bright red" | "bright green" | "bright yellow" |
"bright blue" | "bright magenta" | "bright cyan" | "white" |
Definition in file gp_widgets_color_scheme.h.
enum gp_widgets_color |
Widget theme colors.
The first 10 colors are theme colors, such as default text color, foreground and background color and the next are standard 16 colors.
Definition at line 74 of file gp_widgets_color_scheme.h.
A color scheme.
Decides if the pixmaps generated by application should have dark or light background. There is also default light and dark scheme compiled in the library.
Enumerator | |
---|---|
GP_WIDGET_COLOR_SCHEME_DEFAULT | Default color scheme. |
GP_WIDGET_COLOR_SCHEME_LIGHT | Light color scheme. |
GP_WIDGET_COLOR_SCHEME_DARK | Dark color scheme. |
Definition at line 59 of file gp_widgets_color_scheme.h.
gp_widget * gp_widget_color_scheme_switch | ( | void | ) |
Creates a color scheme switch widget.
gp_pixel gp_widgets_color | ( | const gp_widget_render_ctx * | ctx, |
enum gp_widgets_color | color | ||
) |
Returns a pixel given an color index.
ctx | A widget rendering context. |
color | A color index. |
enum gp_widgets_color gp_widgets_color_name_idx | ( | const char * | name | ) |
Converts a color name into a color index.
name | a color name |
enum gp_widgets_color_scheme gp_widgets_color_scheme_get | ( | void | ) |
Returns current color scheme.
void gp_widgets_color_scheme_set | ( | enum gp_widgets_color_scheme | color_scheme | ) |
Sets a color scheme.
Reloads colors, redraws application.
color_scheme | New color scheme. |
void gp_widgets_color_scheme_toggle | ( | void | ) |
Toggles current color scheme.
Reloads colors, redraws application.