## gcm-color

gcm-color — color functionality

## Synopsis

                        GcmColorRGBint;
                        GcmColorLab;
                        GcmColorYxy;
                        GcmColorXYZ;
                        GcmColorRGB;
    #define             GCM_TYPE_COLOR_RGB
    #define             GCM_TYPE_COLOR_XYZ
    #define             GCM_TYPE_COLOR_YXY
    GType               gcm_color_get_type_XYZ              (void);
    GType               gcm_color_get_type_RGB              (void);
    GType               gcm_color_get_type_Yxy              (void);
    #define             gcm_color_new_XYZ
    #define             gcm_color_new_RGB
    #define             gcm_color_new_Yxy
    #define             gcm_color_free_XYZ
    #define             gcm_color_free_RGB
    #define             gcm_color_free_Yxy
    GcmColorXYZ *       gcm_color_dup_XYZ                   (const GcmColorXYZ *src);
    GcmColorRGB *       gcm_color_dup_RGB                   (const GcmColorRGB *src);
    GcmColorYxy *       gcm_color_dup_Yxy                   (const GcmColorYxy *src);
    void                gcm_color_set_XYZ                   (GcmColorXYZ *dest,
                                                             gdouble X,
                                                             gdouble Y,
                                                             gdouble Z);
    void                gcm_color_set_RGB                   (GcmColorRGB *dest,
                                                             gdouble R,
                                                             gdouble G,
                                                             gdouble B);
    void                gcm_color_set_Yxy                   (GcmColorYxy *dest,
                                                             gdouble Y,
                                                             gdouble x,
                                                             gdouble y);
    void                gcm_color_copy_XYZ                  (const GcmColorXYZ *src,
                                                             GcmColorXYZ *dest);
    void                gcm_color_copy_Yxy                  (const GcmColorYxy *src,
                                                             GcmColorYxy *dest);
    void                gcm_color_clear_XYZ                 (GcmColorXYZ *dest);
    void                gcm_color_copy_RGB                  (const GcmColorRGB *src,
                                                             GcmColorRGB *dest);
    void                gcm_color_convert_RGBint_to_RGB     (const GcmColorRGBint *src,
                                                             GcmColorRGB *dest);
    void                gcm_color_convert_RGB_to_RGBint     (const GcmColorRGB *src,
                                                             GcmColorRGBint *dest);
    void                gcm_color_convert_Yxy_to_XYZ        (const GcmColorYxy *src,
                                                             GcmColorXYZ *dest);
    void                gcm_color_convert_XYZ_to_Yxy        (const GcmColorXYZ *src,
                                                             GcmColorYxy *dest);
    GcmVec3 *           gcm_color_get_XYZ_Vec3              (GcmColorXYZ *src);
    GcmVec3 *           gcm_color_get_RGB_Vec3              (GcmColorRGB *src);

## Description

Functions to manipulate color.

## Details

### GcmColorRGBint

    typedef struct {
    	guint8	 R;
    	guint8	 G;
    	guint8	 B;
    } GcmColorRGBint;

### GcmColorLab

    typedef struct {
    	gdouble	 L;
    	gdouble	 a;
    	gdouble	 b;
    } GcmColorLab;

### GcmColorYxy

    typedef struct {
    	gdouble	 Y;
    	gdouble	 x;
    	gdouble	 y;
    } GcmColorYxy;

### GcmColorXYZ

    typedef struct {
    	gdouble	 X;
    	gdouble	 Y;
    	gdouble	 Z;
    } GcmColorXYZ;

### GcmColorRGB

    typedef struct {
    	gdouble	 R;
    	gdouble	 G;
    	gdouble	 B;
    } GcmColorRGB;

### GCM_TYPE_COLOR_RGB

    #define GCM_TYPE_COLOR_RGB (gcm_color_get_type_RGB ())

### GCM_TYPE_COLOR_XYZ

    #define GCM_TYPE_COLOR_XYZ (gcm_color_get_type_XYZ ())

### GCM_TYPE_COLOR_YXY

    #define GCM_TYPE_COLOR_YXY (gcm_color_get_type_Yxy ())

### gcm_color_get_type_XYZ ()

    GType               gcm_color_get_type_XYZ              (void);

Gets a specific type.

Since 2.91.1

### gcm_color_get_type_RGB ()

    GType               gcm_color_get_type_RGB              (void);

Gets a specific type.

Since 2.91.1

### gcm_color_get_type_Yxy ()

    GType               gcm_color_get_type_Yxy              (void);

Gets a specific type.

Since 2.91.1

### gcm_color_new_XYZ

    #define		 gcm_color_new_XYZ()			g_new0 (GcmColorXYZ, 1)

### gcm_color_new_RGB

    #define		 gcm_color_new_RGB()			g_new0 (GcmColorRGB, 1)

### gcm_color_new_Yxy

    #define		 gcm_color_new_Yxy()			g_new0 (GcmColorYxy, 1)

### gcm_color_free_XYZ

    #define		 gcm_color_free_XYZ			g_free

### gcm_color_free_RGB

    #define		 gcm_color_free_RGB			g_free

### gcm_color_free_Yxy

    #define		 gcm_color_free_Yxy			g_free

### gcm_color_dup_XYZ ()

    GcmColorXYZ *       gcm_color_dup_XYZ                   (const GcmColorXYZ *src);

Since 2.91.1

### gcm_color_dup_RGB ()

    GcmColorRGB *       gcm_color_dup_RGB                   (const GcmColorRGB *src);

Since 2.91.1

### gcm_color_dup_Yxy ()

    GcmColorYxy *       gcm_color_dup_Yxy                   (const GcmColorYxy *src);

Since 2.91.1

### gcm_color_set_XYZ ()

    void                gcm_color_set_XYZ                   (GcmColorXYZ *dest,
                                                             gdouble X,
                                                             gdouble Y,
                                                             gdouble Z);

Initialises a color value.

`dest` : | the destination color
`X` : | component value
`Y` : | component value
`Z` : | component value

Since 2.91.1

### gcm_color_set_RGB ()

    void                gcm_color_set_RGB                   (GcmColorRGB *dest,
                                                             gdouble R,
                                                             gdouble G,
                                                             gdouble B);

Initialises a color value.

`dest` : | the destination color
`R` : | component value
`G` : | component value
`B` : | component value

Since 2.91.1

### gcm_color_set_Yxy ()

    void                gcm_color_set_Yxy                   (GcmColorYxy *dest,
                                                             gdouble Y,
                                                             gdouble x,
                                                             gdouble y);

Initialises a color value.

`dest` : | the destination color
`Y` : | component value
`x` : | component value
`y` : | component value

Since 2.91.1

### gcm_color_copy_XYZ ()

    void                gcm_color_copy_XYZ                  (const GcmColorXYZ *src,
                                                             GcmColorXYZ *dest);

Deep copies a color value.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_copy_Yxy ()

    void                gcm_color_copy_Yxy                  (const GcmColorYxy *src,
                                                             GcmColorYxy *dest);

Deep copies a color value.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_clear_XYZ ()

    void                gcm_color_clear_XYZ                 (GcmColorXYZ *dest);

Initialises a color value.

`dest` : | the destination color

Since 2.91.1

### gcm_color_copy_RGB ()

    void                gcm_color_copy_RGB                  (const GcmColorRGB *src,
                                                             GcmColorRGB *dest);

Deep copies a color value.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_convert_RGBint_to_RGB ()

    void                gcm_color_convert_RGBint_to_RGB     (const GcmColorRGBint *src,
                                                             GcmColorRGB *dest);

Convert from one color format to another.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_convert_RGB_to_RGBint ()

    void                gcm_color_convert_RGB_to_RGBint     (const GcmColorRGB *src,
                                                             GcmColorRGBint *dest);

Convert from one color format to another.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_convert_Yxy_to_XYZ ()

    void                gcm_color_convert_Yxy_to_XYZ        (const GcmColorYxy *src,
                                                             GcmColorXYZ *dest);

Convert from one color format to another.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_convert_XYZ_to_Yxy ()

    void                gcm_color_convert_XYZ_to_Yxy        (const GcmColorXYZ *src,
                                                             GcmColorYxy *dest);

Convert from one color format to another.

`src` : | the source color
`dest` : | the destination color

Since 2.91.1

### gcm_color_get_XYZ_Vec3 ()

    GcmVec3 *           gcm_color_get_XYZ_Vec3              (GcmColorXYZ *src);

Returns the color as a vector component

`src` : | the source color
Returns : | the vector.

Since 2.91.1

### gcm_color_get_RGB_Vec3 ()

    GcmVec3 *           gcm_color_get_RGB_Vec3              (GcmColorRGB *src);

Returns the color as a vector component

`src` : | the source color
Returns : | the vector.

Since 2.91.1