Color
Object Hierarchy:
Description:
A class containing an RGBA color and methods for more powerful color manipulation.
Namespace: Granite.Drawing
Package: granite
Content:
Static methods:
- public static uint8 alpha_from_int (int color)
Extracts the alpha value from the integer value serialized by Granite.Drawing.Color.to_int.
- public static uint8 blue_from_int (int color)
Extracts the blue value from the integer value serialized by Granite.Drawing.Color.to_int.
- public static uint8 green_from_int (int color)
Extracts the green value from the integer value serialized by Granite.Drawing.Color.to_int.
- public static uint8 red_from_int (int color)
Extracts the red value from the integer value serialized by Granite.Drawing.Color.to_int.
Creation methods:
- public Color (double R, double G, double B, double A)
Constructs a new Granite.Drawing.Color with the supplied values.
- public Color.from_gdk (Color color)
Constructs a new Granite.Drawing.Color from a Gdk.Color.
- public Color.from_int (int color)
Constructs a new Granite.Drawing.Color from an integer.
- public Color.from_rgba (RGBA color)
Constructs a new Granite.Drawing.Color from a Gdk.RGBA.
- public Color.from_string (string color)
Constructs a new Granite.Drawing.Color from a string.
Methods:
- public Color add_hue (double val)
Adds the supplied hue value to this color's hue value.
- public Color brighten_val (double amount)
Brightens this color's value by the supplied amount.
- public Color darken_by_sat (double amount)
Darkens this color's value by the supplied amount * color's saturation.
- public Color darken_val (double amount)
Darkens this color's value by the supplied amount.
- public double get_hue ()
Get the value.
- public double get_sat ()
Get the value.
- public double get_val ()
Get the value.
- public Color multiply_sat (double amount)
Multiplies this color's saturation by the supplied amount.
- public Color set_alpha (double alpha)
Changes the value of the alpha channel.
- public Color set_hue (double hue)
Changes the hue of this color to the supplied one.
- public Color set_max_sat (double sat)
Changes this color's saturation to the supplied saturation, if it is smaller than this color's saturation.
- public Color set_max_val (double val)
Changes this color's value to the supplied value, if it is smaller than this color's value.
- public Color set_min_sat (double sat)
Changes this color's saturation to the supplied saturation, if it is greater than this color's saturation.
- public Color set_min_value (double val)
Changes this color's value to the supplied value, if it is greater than this color's value.
- public Color set_sat (double sat)
Changes the saturation of this color to the supplied one.
- public Color set_val (double val)
Changes the value of this color to the supplied one.
- public int to_int ()
Converts this to a 32 bit integer.
- public string to_string ()
Returns a textual specification of this in the form `rgb (r, g, b)` or `rgba (r, g, b, a)`, where “r”, “g”, “b” and “a” represent the red, green, blue and alpha values respectively.
Fields:
- public double A
The value of the alpha channel, with 0 being the lowest value and 1.0 being the greatest value.
- public double B
The value of the blue channel, with 0 being the lowest value and 1.0 being the greatest value.
- public double G
The value of the green channel, with 0 being the lowest value and 1.0 being the greatest value.
- public double R
The value of the red channel, with 0 being the lowest value and 1.0 being the greatest value.
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface
Granite.Services.SettingsSerializable