Creates a copy of color
a newly-allocated Cogl.Color. Use cogl_color_free() to free the allocate resources
Compares two Cogl.Colors and checks if they are the same.
This function can be passed to g_hash_table_new() as the key_equal_func
parameter, when using Cogl.Colors as keys in a GLib.HashTable.
true if the two colors are the same.
Frees the resources allocated by cogl_color_new() and cogl_color_copy()
Retrieves the alpha channel of color as a fixed point
value between 0 and 1.0.
the alpha channel of the passed color
Retrieves the blue channel of color as a fixed point
value between 0 and 1.0.
the blue channel of the passed color
Retrieves the green channel of color as a fixed point
value between 0 and 1.0.
the green channel of the passed color
Retrieves the red channel of color as a fixed point
value between 0 and 1.0.
the red channel of the passed color
Converts a Cogl.Color to a hash value.
This function can be passed to g_hash_table_new() as the hash_func
parameter, when using Cogl.Colors as keys in a GLib.HashTable.
a hash value corresponding to the color
Sets the values of the passed channels into a Cogl.Color
value of the red channel, between 0 and 1.0
value of the green channel, between 0 and 1.0
value of the blue channel, between 0 and 1.0
value of the alpha channel, between 0 and 1.0
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.
Converts color to the HLS format.
The hue value is in the 0 .. 360 range. The luminance and
saturation values are in the 0 .. 1 range.
Returns a textual specification of color in the hexadecimal form
#rrggbbaa, where r, g, b and a are
hexadecimal digits representing the red, green, blue and alpha components
respectively.
a newly-allocated text string
Staticfrom_Parses a string definition of a color, filling the Cogl.Color.red,
Cogl.Color.green, Cogl.Color.blue and Cogl.Color.alpha fields
of color.
The color is not allocated.
The format of str can be either one of:
#rgb, #rrggbb, #rgba, or #rrggbbaargb(r, g, b)rgba(r, g, b, a)hsl(h, s, l)
-a HSL color in the form: hsla(h, s, l, a)where 'r', 'g', 'b' and 'a' are (respectively) the red, green, blue color intensities and the opacity. The 'h', 's' and 'l' are (respectively) the hue, saturation and luminance values.
In the rgb() and rgba() formats, the 'r', 'g', and 'b' values are either
integers between 0 and 255, or percentage values in the range between 0%
and 100%; the percentages require the '%' character. The 'a' value, if
specified, can only be a floating point value between 0.0 and 1.0.
In the hls() and hlsa() formats, the 'h' value (hue) is an angle between
0 and 360.0 degrees; the 'l' and 's' values (luminance and saturation) are
percentage values in the range between 0% and 100%. The 'a' value, if specified,
can only be a floating point value between 0.0 and 1.0.
Whitespace inside the definitions is ignored; no leading whitespace is allowed.
If the alpha component is not specified then it is assumed to be set to be fully opaque.
a string specifying a color
Staticinit_Converts a color expressed in HLS (hue, luminance and saturation) values into a Cogl.Color.
hue value, in the 0 .. 360 range
saturation value, in the 0 .. 1 range
luminance value, in the 0 .. 1 range
A generic color definition
Cogl.Color is a simple structure holding the definition of a color such that it can be efficiently used by GL