GDS-Render v1.2.1
color-palette.c File Reference

Class representing a color palette. More...

Include dependency graph for color-palette.c:

Go to the source code of this file.

Data Structures

struct  _ColorPalette
 

Functions

static int count_non_empty_lines_in_array (const char *data, size_t length)
 Return the number of non empty lines in array. More...
 
static int color_palette_fill_with_resource (ColorPalette *palette, char *resource_name)
 color_palette_fill_with_resource More...
 
ColorPalette * color_palette_new_from_resource (char *resource_name)
 Create a new object with from a resource containing the html hex color scheme. More...
 
GdkRGBA * color_palette_get_color (ColorPalette *palette, GdkRGBA *color, unsigned int index)
 Get the n-th color in the palette identified by the index. More...
 
unsigned int color_palette_get_color_count (ColorPalette *palette)
 Return amount of stored colors in palette. More...
 
static void color_palette_dispose (GObject *gobj)
 
static void color_palette_class_init (ColorPaletteClass *klass)
 
static void color_palette_init (ColorPalette *self)
 

Detailed Description

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.

Function Documentation

◆ color_palette_class_init()

static void color_palette_class_init ( ColorPaletteClass *  klass)
static

Definition at line 248 of file color-palette.c.

Here is the call graph for this function:

◆ color_palette_dispose()

static void color_palette_dispose ( GObject *  gobj)
static

Definition at line 233 of file color-palette.c.

Here is the caller graph for this function:

◆ color_palette_fill_with_resource()

static int color_palette_fill_with_resource ( ColorPalette *  palette,
char *  resource_name 
)
static

color_palette_fill_with_resource

Parameters
palette
resource_name
Returns
0 if successful

Definition at line 84 of file color-palette.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
paletteColor palette
colorGdkRGBA struct to fill data in. May be NULL.
indexIndex 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.

Here is the caller graph for this function:

◆ color_palette_get_color_count()

unsigned int color_palette_get_color_count ( ColorPalette *  palette)

Return amount of stored colors in palette.

Parameters
paletteColor palette
Returns
Count of colors

Definition at line 223 of file color-palette.c.

Here is the caller graph for this function:

◆ color_palette_init()

static void color_palette_init ( ColorPalette *  self)
static

Definition at line 256 of file color-palette.c.

◆ 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_nameName of the resource
Returns
New object

Definition at line 188 of file color-palette.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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]dataArray to count lines in
[in]lengthLength of data
Returns
< 0: Error, >=0: Lines

Definition at line 55 of file color-palette.c.

Here is the caller graph for this function: