Cogl.Color
Description: Reference for Cogl.Color

### Struct

# CoglColor

#### Description [src]

    struct CoglColor {
      uint8_t red;
      uint8_t green;
      uint8_t blue;
      uint8_t alpha;
    }

A generic color definition

`CoglColor` is a simple structure holding the definition of a color such that it can be efficiently used by GL.

###### Structure members

`red:` `uint8_t`

  No description available.

`green:` `uint8_t`

  No description available.

`blue:` `uint8_t`

  No description available.

`alpha:` `uint8_t`

  No description available.

#### Functions

###### cogl_color_from_string

Parses a string definition of a color, filling the `CoglColor`.red, `CoglColor`.green, `CoglColor`.blue and `CoglColor`.alpha fields of `color`.

###### cogl_color_init_from_hsl

Converts a color expressed in HLS (hue, luminance and saturation) values into a `CoglColor`.

#### Instance methods

###### cogl_color_copy

Creates a copy of `color`.

###### cogl_color_equal

Compares two `CoglColor`s and checks if they are the same.

###### cogl_color_free

Frees the resources allocated by `cogl_color_new()` and cogl_color_copy().

###### cogl_color_get_alpha

Retrieves the alpha channel of `color` as a fixed point value between 0 and 1.0.

###### cogl_color_get_blue

Retrieves the blue channel of `color` as a fixed point value between 0 and 1.0.

###### cogl_color_get_green

Retrieves the green channel of `color` as a fixed point value between 0 and 1.0.

###### cogl_color_get_red

Retrieves the red channel of `color` as a fixed point value between 0 and 1.0.

###### cogl_color_hash

Converts a `CoglColor` to a hash value.

###### cogl_color_init_from_4f

Sets the values of the passed channels into a `CoglColor`.

###### cogl_color_premultiply

Converts a non-premultiplied color to a pre-multiplied color. For example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied and (0.5, 0, 0, 0.5) when premultiplied.

###### cogl_color_to_hsl

Converts `color` to the HLS format.

###### cogl_color_to_string

Returns a textual specification of `color` in the hexadecimal form `&num;rrggbbaa`, where `r`, `g`, `b` and `a` are hexadecimal digits representing the red, green, blue and alpha components respectively.