Synopsis

#include <adg-1/adg.h>

struct              AdgColorStyle;
struct              AdgColorStyleClass;
AdgColorStyle *     adg_color_style_new                 (void);
void                adg_color_style_set_red             (AdgColorStyle *color_style,
                                                         gdouble red);
gdouble             adg_color_style_get_red             (AdgColorStyle *color_style);
void                adg_color_style_set_green           (AdgColorStyle *color_style,
                                                         gdouble green);
gdouble             adg_color_style_get_green           (AdgColorStyle *color_style);
void                adg_color_style_set_blue            (AdgColorStyle *color_style,
                                                         gdouble blue);
gdouble             adg_color_style_get_blue            (AdgColorStyle *color_style);
void                adg_color_style_set_rgb             (AdgColorStyle *color_style,
                                                         gdouble red,
                                                         gdouble green,
                                                         gdouble blue);
void                adg_color_style_put_rgb             (AdgColorStyle *color_style,
                                                         gdouble *red,
                                                         gdouble *green,
                                                         gdouble *blue);
void                adg_color_style_set_alpha           (AdgColorStyle *color_style,
                                                         gdouble alpha);
gdouble             adg_color_style_get_alpha           (AdgColorStyle *color_style);

Object Hierarchy

  GObject
   +----AdgStyle
         +----AdgColorStyle

Properties

  "alpha"                    gdouble               : Read / Write
  "blue"                     gdouble               : Read / Write
  "green"                    gdouble               : Read / Write
  "red"                      gdouble               : Read / Write

Description

A style containing a single color expressed in RGB format. AdgColorStyle also supports the alpha compositing that should be expressed with a double value between 0 and 1, where 0 is the "completely transparent" value while 1 is "fully opaque".

Details

struct AdgColorStyle

struct AdgColorStyle;

All fields are private and should not be used directly. Use its public methods instead.

Since 1.0


struct AdgColorStyleClass

struct AdgColorStyleClass {
};

adg_color_style_new ()

AdgColorStyle *     adg_color_style_new                 (void);

Constructs a new color initialized to opaque black.

Returns :

a new color style

Since 1.0


adg_color_style_set_red ()

void                adg_color_style_set_red             (AdgColorStyle *color_style,
                                                         gdouble red);

Sets a new value for the red channel, where 0 means no red and 1 is full red.

color_style :

an AdgColorStyle

red :

the new value

Since 1.0


adg_color_style_get_red ()

gdouble             adg_color_style_get_red             (AdgColorStyle *color_style);

Gets the current value of the red channel, where 0 means no red and 1 is full red.

color_style :

an AdgColorStyle

Returns :

the requested red value

Since 1.0


adg_color_style_set_green ()

void                adg_color_style_set_green           (AdgColorStyle *color_style,
                                                         gdouble green);

Sets a new value for the green channel, where 0 means no green and 1 is full green.

color_style :

an AdgColorStyle

green :

the new value

Since 1.0


adg_color_style_get_green ()

gdouble             adg_color_style_get_green           (AdgColorStyle *color_style);

Gets the current value of the green channel, where 0 means no green and 1 is full green.

color_style :

an AdgColorStyle

Returns :

the requested green value

Since 1.0


adg_color_style_set_blue ()

void                adg_color_style_set_blue            (AdgColorStyle *color_style,
                                                         gdouble blue);

Sets a new value for the blue channel, where 0 means no blue and 1 is full blue.

color_style :

an AdgColorStyle

blue :

the new value

Since 1.0


adg_color_style_get_blue ()

gdouble             adg_color_style_get_blue            (AdgColorStyle *color_style);

Gets the current value of the blue channel, where 0 means no blue and 1 is full blue.

color_style :

an AdgColorStyle

Returns :

the requested blue value

Since 1.0


adg_color_style_set_rgb ()

void                adg_color_style_set_rgb             (AdgColorStyle *color_style,
                                                         gdouble red,
                                                         gdouble green,
                                                         gdouble blue);

Sets the RGB channels at once.

color_style :

an AdgColorStyle

red :

the red channel value

green :

the green channel value

blue :

the blue channel value

Since 1.0


adg_color_style_put_rgb ()

void                adg_color_style_put_rgb             (AdgColorStyle *color_style,
                                                         gdouble *red,
                                                         gdouble *green,
                                                         gdouble *blue);

Gets the values of the red, green and blue channels of color_style. Any of the pointer can be NULL, in which case the value is not returned.

color_style :

an AdgColorStyle

red :

where to store the red channel value

green :

where to store the green channel value

blue :

where to store the blue channel value

Since 1.0


adg_color_style_set_alpha ()

void                adg_color_style_set_alpha           (AdgColorStyle *color_style,
                                                         gdouble alpha);

Sets a new color alpha value, where 0 means completely transparent and 1 is fully opaque.

color_style :

an AdgColorStyle

alpha :

the new alpha

Since 1.0


adg_color_style_get_alpha ()

gdouble             adg_color_style_get_alpha           (AdgColorStyle *color_style);

Gets the alpha channel value, where 0 means completely transparent and 1 is fully opaque.

color_style :

an AdgColorStyle

Returns :

the requested alpha value

Since 1.0

Property Details

The "alpha" property

  "alpha"                    gdouble               : Read / Write

The alpha value, where 0 means completely transparent and 1 is fully opaque.

Allowed values: [0,1]

Default value: 1


The "blue" property

  "blue"                     gdouble               : Read / Write

The blue value, where 0 means no blue and 1 is full blue.

Allowed values: [0,1]

Default value: 0


The "green" property

  "green"                    gdouble               : Read / Write

The green value, where 0 means no green and 1 is full green.

Allowed values: [0,1]

Default value: 0


The "red" property

  "red"                      gdouble               : Read / Write

The red value, where 0 means no red and 1 is full red.

Allowed values: [0,1]

Default value: 0