Color
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "CLUTTER_TYPE_COLOR" ) ]
public struct Color
public struct Color
Color representation.
Namespace: Clutter
Package: clutter-1.0
Content:
Static methods:
- public static Color? alloc ()
Allocates a new, transparent black Color.
- public static unowned Color? get_static (StaticColor color)
Retrieves a static color for the given
color
name
Creation methods:
- public Color.from_hls (float hue, float luminance, float saturation)
Converts a color expressed in HLS (hue, luminance and saturation) values into a Color.
- public Color.from_pixel (uint32 pixel)
Converts
pixel
from the packed representation of a four 8 bit channel color to a Color. - public Color.from_string (string str)
Methods:
- public Color add (Color b)
Adds this to
b
and saves the resulting color insideresult
. - public Color? copy ()
Makes a copy of the color structure.
- public Color darken ()
Darkens this by a fixed amount, and saves the changed color in
result
. - public bool equal (Color v2)
Compares two Colors and checks if they are the same.
- public void free ()
Frees a color structure created with copy.
- public uint hash ()
Converts a Color to a hash value.
- public unowned Color? init (uint8 red, uint8 green, uint8 blue, uint8 alpha)
Initializes this with the given values.
- public Color interpolate (Color final, double progress)
Interpolates between this and
final
Colors usingprogress
- public Color lighten ()
Lightens this by a fixed amount, and saves the changed color in
result
. - public bool parse_string (string str)
- public Color shade (double factor)
Shades this by
factor
and saves the modified color intoresult
. - public Color subtract (Color b)
Subtracts
b
from this and saves the resulting color insideresult
. - public void to_hls (out float hue, out float luminance, out float saturation)
Converts this to the HLS format.
- public uint32 to_pixel ()
Converts this into a packed 32 bit integer, containing all the four 8 bit channels used by Color.
- public string to_string ()
Returns a textual specification of this in the hexadecimal form #rrggbbaa, where r, g, b and a are hexadecimal digits representing the red, green, blue and alpha components respectively.