Class representing a color palette.
More...
Go to the source code of this file.
Class representing a color palette.
- Author
- Mario Hüttel mario.nosp@m..hue.nosp@m.ttel@.nosp@m.gmx..nosp@m.net
Definition in file color-palette.c.
◆ color_palette_class_init()
static void color_palette_class_init |
( |
ColorPaletteClass * |
klass | ) |
|
|
static |
◆ color_palette_dispose()
static void color_palette_dispose |
( |
GObject * |
gobj | ) |
|
|
static |
◆ color_palette_fill_with_resource()
static int color_palette_fill_with_resource |
( |
ColorPalette * |
palette, |
|
|
char * |
resource_name |
|
) |
| |
|
static |
color_palette_fill_with_resource
- Parameters
-
- Returns
- 0 if successful
Definition at line 84 of file color-palette.c.
◆ color_palette_get_color()
GdkRGBA * color_palette_get_color |
( |
ColorPalette * |
palette, |
|
|
GdkRGBA * |
color, |
|
|
unsigned int |
index |
|
) |
| |
Get the n-th color in the palette identified by the index.
This function fills the nth color into the supplied color
. color
is returned.
If color
is NULL, a new GdkRGBA is created and returned. This element must be freed afterwards.
- Parameters
-
palette | Color palette |
color | GdkRGBA struct to fill data in. May be NULL. |
index | Index of color. Starts at 0 |
- Returns
- GdkRGBA color. If
color
is NULL, the returned color must be freed afterwards
Definition at line 199 of file color-palette.c.
◆ color_palette_get_color_count()
unsigned int color_palette_get_color_count |
( |
ColorPalette * |
palette | ) |
|
Return amount of stored colors in palette
.
- Parameters
-
- Returns
- Count of colors
Definition at line 223 of file color-palette.c.
◆ color_palette_init()
static void color_palette_init |
( |
ColorPalette * |
self | ) |
|
|
static |
◆ color_palette_new_from_resource()
ColorPalette * color_palette_new_from_resource |
( |
char * |
resource_name | ) |
|
Create a new object with from a resource containing the html hex color scheme.
- Parameters
-
resource_name | Name of the resource |
- Returns
- New object
Definition at line 188 of file color-palette.c.
◆ count_non_empty_lines_in_array()
static int count_non_empty_lines_in_array |
( |
const char * |
data, |
|
|
size_t |
length |
|
) |
| |
|
static |
Return the number of non empty lines in array.
This function returns the number of non empty lines in an array. The scanning is either terminated by the given length or if a \0 terminator is found.
- Parameters
-
[in] | data | Array to count lines in |
[in] | length | Length of data |
- Returns
- < 0: Error, >=0: Lines
Definition at line 55 of file color-palette.c.