Color

Color

Synopsis

void                plank_drawing_color_to_gdk_color    (PlankDrawingColor *self,
                                                         GdkColor *result);
void                plank_drawing_color_to_gdk_rgba     (PlankDrawingColor *self,
                                                         GdkRGBA *result);
gboolean            plank_drawing_color_equal           (PlankDrawingColor *self,
                                                         PlankDrawingColor *color);
void                plank_drawing_color_set_hsv         (PlankDrawingColor *self,
                                                         gdouble h,
                                                         gdouble s,
                                                         gdouble v);
void                plank_drawing_color_set_hue         (PlankDrawingColor *self,
                                                         gdouble hue);
void                plank_drawing_color_set_sat         (PlankDrawingColor *self,
                                                         gdouble sat);
void                plank_drawing_color_set_val         (PlankDrawingColor *self,
                                                         gdouble val);
void                plank_drawing_color_set_alpha       (PlankDrawingColor *self,
                                                         gdouble alpha);
void                plank_drawing_color_get_hsv         (PlankDrawingColor *self,
                                                         gdouble *h,
                                                         gdouble *s,
                                                         gdouble *v);
gdouble             plank_drawing_color_get_hue         (PlankDrawingColor *self);
gdouble             plank_drawing_color_get_sat         (PlankDrawingColor *self);
gdouble             plank_drawing_color_get_val         (PlankDrawingColor *self);
void                plank_drawing_color_add_hue         (PlankDrawingColor *self,
                                                         gdouble val);
void                plank_drawing_color_set_min_sat     (PlankDrawingColor *self,
                                                         gdouble sat);
void                plank_drawing_color_set_min_value   (PlankDrawingColor *self,
                                                         gdouble val);
void                plank_drawing_color_set_max_sat     (PlankDrawingColor *self,
                                                         gdouble sat);
void                plank_drawing_color_set_max_val     (PlankDrawingColor *self,
                                                         gdouble val);
void                plank_drawing_color_multiply_sat    (PlankDrawingColor *self,
                                                         gdouble amount);
void                plank_drawing_color_brighten_val    (PlankDrawingColor *self,
                                                         gdouble amount);
void                plank_drawing_color_darken_val      (PlankDrawingColor *self,
                                                         gdouble amount);
void                plank_drawing_color_darken_by_sat   (PlankDrawingColor *self,
                                                         gdouble amount);
gchar *             plank_drawing_color_to_string       (PlankDrawingColor *self);
void                plank_drawing_color_from_gdk_color  (GdkColor *color,
                                                         PlankDrawingColor *result);
void                plank_drawing_color_from_gdk_rgba   (GdkRGBA *color,
                                                         PlankDrawingColor *result);
void                plank_drawing_color_from_string     (const gchar *s,
                                                         PlankDrawingColor *result);
struct              PlankDrawingColor;
PlankDrawingColor * plank_drawing_color_dup             (const PlankDrawingColor *self);
void                plank_drawing_color_free            (PlankDrawingColor *self);

Object Hierarchy

  GBoxed
   +----PlankDrawingColor

Description

Details

plank_drawing_color_to_gdk_color ()

void                plank_drawing_color_to_gdk_color    (PlankDrawingColor *self,
                                                         GdkColor *result);

Creates a new GdkColor.from this color

self :

the PlankDrawingColor instance

Returns :

new GdkColor

plank_drawing_color_to_gdk_rgba ()

void                plank_drawing_color_to_gdk_rgba     (PlankDrawingColor *self,
                                                         GdkRGBA *result);

Creates a new GdkRGBA.from this color

self :

the PlankDrawingColor instance

Returns :

new GdkRGBA

plank_drawing_color_equal ()

gboolean            plank_drawing_color_equal           (PlankDrawingColor *self,
                                                         PlankDrawingColor *color);

Check equality with the give color

self :

the PlankDrawingColor instance

color :

 

Returns :

whether the give color equals this color.

plank_drawing_color_set_hsv ()

void                plank_drawing_color_set_hsv         (PlankDrawingColor *self,
                                                         gdouble h,
                                                         gdouble s,
                                                         gdouble v);

Set HSV color values of this color.

self :

the PlankDrawingColor instance

h :

 

s :

 

v :

 

plank_drawing_color_set_hue ()

void                plank_drawing_color_set_hue         (PlankDrawingColor *self,
                                                         gdouble hue);

Sets the hue for the color.

self :

the PlankDrawingColor instance

hue :

 . the new hue for the color. [in]

plank_drawing_color_set_sat ()

void                plank_drawing_color_set_sat         (PlankDrawingColor *self,
                                                         gdouble sat);

Sets the saturation for the color.

self :

the PlankDrawingColor instance

sat :

 . the new saturation for the color. [in]

plank_drawing_color_set_val ()

void                plank_drawing_color_set_val         (PlankDrawingColor *self,
                                                         gdouble val);

Sets the value for the color.

self :

the PlankDrawingColor instance

val :

 . the new value for the color. [in]

plank_drawing_color_set_alpha ()

void                plank_drawing_color_set_alpha       (PlankDrawingColor *self,
                                                         gdouble alpha);

Sets the alpha for the color.

self :

the PlankDrawingColor instance

alpha :

 . the new alpha for the color. [in]

plank_drawing_color_get_hsv ()

void                plank_drawing_color_get_hsv         (PlankDrawingColor *self,
                                                         gdouble *h,
                                                         gdouble *s,
                                                         gdouble *v);

Get HSV color values of this color.

self :

the PlankDrawingColor instance

h :

 

s :

 

v :

 

plank_drawing_color_get_hue ()

gdouble             plank_drawing_color_get_hue         (PlankDrawingColor *self);

Returns the hue for the color.

self :

the PlankDrawingColor instance

Returns :

the hue for the color

plank_drawing_color_get_sat ()

gdouble             plank_drawing_color_get_sat         (PlankDrawingColor *self);

Returns the saturation for the color.

self :

the PlankDrawingColor instance

Returns :

the saturation for the color

plank_drawing_color_get_val ()

gdouble             plank_drawing_color_get_val         (PlankDrawingColor *self);

Returns the value for the color.

self :

the PlankDrawingColor instance

Returns :

the value for the color

plank_drawing_color_add_hue ()

void                plank_drawing_color_add_hue         (PlankDrawingColor *self,
                                                         gdouble val);

Increases the color's hue.

self :

the PlankDrawingColor instance

val :

 . the amount to add to the hue. [in]

plank_drawing_color_set_min_sat ()

void                plank_drawing_color_set_min_sat     (PlankDrawingColor *self,
                                                         gdouble sat);

Limits the color's saturation.

self :

the PlankDrawingColor instance

sat :

 . the minimum saturation allowed. [in]

plank_drawing_color_set_min_value ()

void                plank_drawing_color_set_min_value   (PlankDrawingColor *self,
                                                         gdouble val);

Limits the color's value.

self :

the PlankDrawingColor instance

val :

 . the minimum value allowed. [in]

plank_drawing_color_set_max_sat ()

void                plank_drawing_color_set_max_sat     (PlankDrawingColor *self,
                                                         gdouble sat);

Limits the color's saturation.

self :

the PlankDrawingColor instance

sat :

 . the maximum saturation allowed. [in]

plank_drawing_color_set_max_val ()

void                plank_drawing_color_set_max_val     (PlankDrawingColor *self,
                                                         gdouble val);

Limits the color's value.

self :

the PlankDrawingColor instance

val :

 . the maximum value allowed. [in]

plank_drawing_color_multiply_sat ()

void                plank_drawing_color_multiply_sat    (PlankDrawingColor *self,
                                                         gdouble amount);

Multiplies the color's saturation using the amount.

self :

the PlankDrawingColor instance

amount :

 . amount to multiply the saturation by. [in]

plank_drawing_color_brighten_val ()

void                plank_drawing_color_brighten_val    (PlankDrawingColor *self,
                                                         gdouble amount);

Brighten the color's value using the value.

self :

the PlankDrawingColor instance

amount :

 . percent of the value to brighten by. [in]

plank_drawing_color_darken_val ()

void                plank_drawing_color_darken_val      (PlankDrawingColor *self,
                                                         gdouble amount);

Darkens the color's value using the value.

self :

the PlankDrawingColor instance

amount :

 . percent of the value to darken by. [in]

plank_drawing_color_darken_by_sat ()

void                plank_drawing_color_darken_by_sat   (PlankDrawingColor *self,
                                                         gdouble amount);

Darkens the color's value using the saturtion.

self :

the PlankDrawingColor instance

amount :

 . percent of the saturation to darken by. [in]

plank_drawing_color_to_string ()

gchar *             plank_drawing_color_to_string       (PlankDrawingColor *self);

Convert color to string formatted like "d;;d;;d;;d" with numeric entries ranged in 0..255

self :

the PlankDrawingColor instance

Returns :

the string representation of this color

plank_drawing_color_from_gdk_color ()

void                plank_drawing_color_from_gdk_color  (GdkColor *color,
                                                         PlankDrawingColor *result);

Creates a new color from a GdkColor.

color :

 . the color to use. [in]

Returns :

new PlankDrawingColor based on the given one

plank_drawing_color_from_gdk_rgba ()

void                plank_drawing_color_from_gdk_rgba   (GdkRGBA *color,
                                                         PlankDrawingColor *result);

Creates a new color from a GdkRGBA.

color :

 . the color to use. [in]

Returns :

new PlankDrawingColor based on the given one

plank_drawing_color_from_string ()

void                plank_drawing_color_from_string     (const gchar *s,
                                                         PlankDrawingColor *result);

Create new color converted from string formatted like "d;;d;;d;;d" with numeric entries ranged in 0..255

s :

 

Returns :

new PlankDrawingColor based on the given string

struct PlankDrawingColor

struct PlankDrawingColor {
	gdouble R;
	gdouble G;
	gdouble B;
	gdouble A;
};

Represents a RGBA color and has methods for manipulating the color.

gdouble R;

The red value for the color.

gdouble G;

The green value for the color.

gdouble B;

The blue value for the color.

gdouble A;

The alpha value for the color.

plank_drawing_color_dup ()

PlankDrawingColor * plank_drawing_color_dup             (const PlankDrawingColor *self);

Creates a copy of self.

See also: plank_drawing_color_copy(), plank_drawing_color_destroy(), plank_drawing_color_free()

self :

the instance to duplicate

Returns :

a copy of self, free with plank_drawing_color_free()

plank_drawing_color_free ()

void                plank_drawing_color_free            (PlankDrawingColor *self);

Frees the heap-allocated struct.

See also: plank_drawing_color_dup(), plank_drawing_color_copy(), plank_drawing_color_destroy()

self :

the struct to free