Color
Object Hierarchy:
Granite.Drawing.Color
Granite.Drawing.Color
Granite.Drawing.Color
GLib.Object
GLib.Object
GLib.Object->Granite.Drawing.Color
Granite.Services.SettingsSerializable
Granite.Services.SettingsSerializable
Granite.Services.SettingsSerializable->Granite.Drawing.Color
Description:
public class Color :
Object ,
SettingsSerializable
A class containing an RGBA color and methods for more powerful color manipulation.
Content:
Static methods:
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
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface
Granite.Services.SettingsSerializable