Color
Object Hierarchy:
Description:
[ CCode ( has_type_id = false ) ]
public struct Color
public struct Color
A structure for holding a color definition.
The contents of the CoglColor structure are private and should never by accessed directly.
Namespace: Cogl
Package: cogl-1.0
Content:
Static methods:
Creation methods:
- public Color.from_4f (float red, float green, float blue, float alpha)
Sets the values of the passed channels into a Color
- public Color.from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha)
Sets the values of the passed channels into a Color .
Methods:
- public Color copy ()
Creates a copy of this
- public float get_alpha ()
Retrieves the alpha channel of this as a fixed point value between 0 and 1.0.
- public uint get_alpha_byte ()
Retrieves the alpha channel of this as a byte value between 0 and 255
- public float get_alpha_float ()
Retrieves the alpha channel of this as a floating point value between 0.0 and 1.0
- public float get_blue ()
Retrieves the blue channel of this as a fixed point value between 0 and 1.0.
- public uint get_blue_byte ()
Retrieves the blue channel of this as a byte value between 0 and 255
- public float get_blue_float ()
Retrieves the blue channel of this as a floating point value between 0.0 and 1.0
- public float get_green ()
Retrieves the green channel of this as a fixed point value between 0 and 1.0.
- public uint get_green_byte ()
Retrieves the green channel of this as a byte value between 0 and 255
- public float get_green_float ()
Retrieves the green channel of this as a floating point value between 0.0 and 1.0
- public float get_red ()
Retrieves the red channel of this as a fixed point value between 0 and 1.0.
- public uint get_red_byte ()
Retrieves the red channel of this as a byte value between 0 and 255
- public float get_red_float ()
Retrieves the red channel of this as a floating point value between 0.0 and 1.0
- public void init_from_4f (float red, float green, float blue, float alpha)
- public void init_from_4fv (float color_array)
Sets the values of the passed channels into a Color
- public void init_from_4ub (uchar red, uchar green, uchar blue, uchar alpha)
- public void premultiply ()
Converts a non-premultiplied color to a pre-multiplied color.
- public void set_alpha (float alpha)
Sets the alpha channel of this to
alpha
. - public void set_alpha_byte (uint alpha)
Sets the alpha channel of this to
alpha
. - public void set_alpha_float (float alpha)
Sets the alpha channel of this to
alpha
. - public void set_blue (float blue)
Sets the blue channel of this to
blue
. - public void set_blue_byte (uint blue)
Sets the blue channel of this to
blue
. - public void set_blue_float (float blue)
Sets the blue channel of this to
blue
. - public void set_from_4f (float red, float green, float blue, float alpha)
Sets the values of the passed channels into a Color
- public void set_from_4ub (uchar red, uchar green, uchar blue, uchar alpha)
Sets the values of the passed channels into a Color .
- public void set_green (float green)
Sets the green channel of this to
green
. - public void set_green_byte (uint green)
Sets the green channel of this to
green
. - public void set_green_float (float green)
Sets the green channel of this to
green
. - public void set_red (float red)
Sets the red channel of this to
red
. - public void set_red_byte (uint red)
Sets the red channel of this to
red
. - public void set_red_float (float red)
Sets the red channel of this to
red
. - public void unpremultiply ()
Converts a pre-multiplied color to a non-premultiplied color.