## GeglColor

GeglColor

## Functions

GeglColor * | gegl_color_new ()
GeglColor * | gegl_color_duplicate ()
void | gegl_color_get_rgba ()
void | gegl_color_set_rgba ()
void | gegl_color_set_pixel ()
void | gegl_color_get_pixel ()
GParamSpec * | gegl_param_spec_color ()
GParamSpec * | gegl_param_spec_color_from_string ()
GeglColor * | gegl_param_spec_color_get_default ()
const Babl * | gegl_color_get_format ()

## Types and Values

| GeglColor

## Description

## Functions

### gegl_color_new ()

    GeglColor *
    gegl_color_new (const gchar *string);

Creates a new GeglColor.

Returns the newly created GeglColor.

#### Parameters

string | a string describing the color to be created. |

### gegl_color_duplicate ()

    GeglColor *
    gegl_color_duplicate (GeglColor *color);

Creates a copy of `color` .

#### Parameters

color | the color to duplicate. |

#### Returns

A new copy of `color` .

[transfer full]

### gegl_color_get_rgba ()

    void
    gegl_color_get_rgba (GeglColor *color,
                         gdouble *red,
                         gdouble *green,
                         gdouble *blue,
                         gdouble *alpha);

Retrieves the current set color as linear light non premultipled RGBA data, any of the return pointers can be omitted.

#### Parameters

color | a GeglColor |
red | red return location. | [out]
green | green return location. | [out]
blue | blue return location. | [out]
alpha | alpha return location. | [out]

### gegl_color_set_rgba ()

    void
    gegl_color_set_rgba (GeglColor *color,
                         gdouble red,
                         gdouble green,
                         gdouble blue,
                         gdouble alpha);

Set color as linear light non premultipled RGBA data

#### Parameters

color | a GeglColor |
red | red value |
green | green value |
blue | blue value |
alpha | alpha value |

### gegl_color_set_pixel ()

    void
    gegl_color_set_pixel (GeglColor *color,
                          const Babl *format,
                          const void *pixel);

Set a GeglColor from a pointer to a pixel and it's babl format.

[skip]

#### Parameters

color | a GeglColor |
format | a babl pixel format |
pixel | pointer to a pixel |

### gegl_color_get_pixel ()

    void
    gegl_color_get_pixel (GeglColor *color,
                          const Babl *format,
                          void *pixel);

Store the color in a pixel in the given format.

[skip]

#### Parameters

color | a GeglColor |
format | a babl pixel format |
pixel | pointer to a pixel |

### gegl_param_spec_color ()

    GParamSpec *
    gegl_param_spec_color (const gchar *name,
                           const gchar *nick,
                           const gchar *blurb,
                           GeglColor *default_color,
                           GParamFlags flags);

Creates a new GParamSpec instance specifying a GeglColor property.

#### Parameters

name | canonical name of the property specified |
nick | nick name for the property specified |
blurb | description of the property specified |
default_color | the default value for the property specified |
flags | flags for the property specified |

#### Returns

a newly created parameter specification.

[transfer full]

### gegl_param_spec_color_from_string ()

    GParamSpec *
    gegl_param_spec_color_from_string (const gchar *name,
                                       const gchar *nick,
                                       const gchar *blurb,
                                       const gchar *default_color_string,
                                       GParamFlags flags);

Creates a new GParamSpec instance specifying a GeglColor property.

#### Parameters

name | canonical name of the property specified |
nick | nick name for the property specified |
blurb | description of the property specified |
default_color_string | the default value for the property specified |
flags | flags for the property specified |

#### Returns

a newly created parameter specification.

[transfer full]

### gegl_param_spec_color_get_default ()

    GeglColor *
    gegl_param_spec_color_get_default (GParamSpec *self);

Get the default color value of the param spec

#### Parameters

self | a GeglColor GParamSpec |

#### Returns

the default GeglColor.

[transfer none]

### gegl_color_get_format ()

    const Babl *
    gegl_color_get_format (GeglColor *color);

Return: (transfer none): the pixel format encoding of the set color.

#### Parameters

color | a GeglColor |

## Types and Values

### GeglColor

    typedef struct {
      GObject           parent_instance;
      GeglColorPrivate *priv;
    } GeglColor;