cluttermm: Clutter::Color Class Reference
Public Member Functions | |
Color (ClutterColor* gobject, bool make_a_copy=true) | |
Color (const Color& other) | |
Color& | operator= (const Color& other) |
~Color () | |
void | swap (Color& other) |
ClutterColor* | gobj () |
Provides access to the underlying C instance. More... | |
const ClutterColor* | gobj () const |
Provides access to the underlying C instance. More... | |
ClutterColor* | gobj_copy () const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More... | |
Color () | |
Color (guint8 red, guint8 green, guint8 blue, guint8 alpha=255) | |
Create a new Color object by specifying its value in RGB(A) More... | |
Color (guint32 pixel) | |
Create a new Color object by specifying its pixel value. More... | |
Color (const Glib::ustring& color) | |
Color (StaticColor color) | |
void | set_from_rgb (guint8 red, guint8 blue, guint8 green) |
void | set_from_string (const Glib::ustring& color) |
Glib::ustring | to_string () const |
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. More... | |
void | set_from_hls (float hue, float luminance, float saturation) |
Converts a color expressed in HLS (hue, luminance and saturation) values into a Clutter::Color. More... | |
void | to_hls (float& hue, float& luminance, float& saturation) const |
Converts color to the HLS format. More... | |
void | set_from_pixel (guint32 pixel) |
Converts pixel from the packed representation of a four 8 bit channel color to a Clutter::Color. More... | |
guint32 | to_pixel () const |
Converts color into a packed 32 bit integer, containing all the four 8 bit channels used by Clutter::Color. More... | |
Color | add (const Color& color) const |
Adds a to b and saves the resulting color inside result. More... | |
Color | subtract (const Color& color) const |
Subtracts b from a and saves the resulting color inside result. More... | |
void | darken () |
Darkens color by a fixed amount, and saves the changed color in result. More... | |
void | lighten () |
Lightens color by a fixed amount, and saves the changed color in result. More... | |
void | shade (double shade) |
Shades color by factor and saves the modified color into result. More... | |
Color | interpolate (const Color& final, double progress) const |
Interpolates between this initial color and a final color. More... | |
guint8 | get_red () const |
void | set_red (const guint8& value) |
guint8 | get_green () const |
void | set_green (const guint8& value) |
guint8 | get_blue () const |
void | set_blue (const guint8& value) |
guint8 | get_alpha () const |
void | set_alpha (const guint8& value) |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Attributes | |
ClutterColor* | gobject_ |
Related Functions | |
(Note that these are not member functions.) | |
Color | operator+ (const Color& color1, const Color& color2) |
Color | operator- (const Color& color1, const Color& color2) |
bool | operator== (const Color& lhs, const Color& rhs) |
bool | operator!= (const Color& lhs, const Color& rhs) |
void | swap (Color& lhs, Color& rhs) |
Clutter::Color | wrap (ClutterColor* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Constructor & Destructor Documentation
|
explicit |
Clutter::Color::Color | ( | const Color& | other) |
Clutter::Color::~Color | ( | ) |
Clutter::Color::Color | ( | ) |
Clutter::Color::Color | ( | guint8 | red, |
guint8 | green, | ||
guint8 | blue, | ||
guint8 | alpha = 255 |
||
) |
Create a new Color object by specifying its value in RGB(A)
|
explicit |
Create a new Color object by specifying its pixel value.
|
explicit |
|
explicit |
Member Function Documentation
Adds a to b and saves the resulting color inside result.
The alpha channel of result is set as as the maximum value between the alpha channels of a and b.
- Parameters
-
b A Clutter::Color. result Return location for the result.
void Clutter::Color::darken | ( | ) |
Darkens color by a fixed amount, and saves the changed color in result.
- Parameters
-
result Return location for the darker color.
guint8 Clutter::Color::get_alpha | ( | ) | const |
guint8 Clutter::Color::get_blue | ( | ) | const |
guint8 Clutter::Color::get_green | ( | ) | const |
guint8 Clutter::Color::get_red | ( | ) | const |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C instance.
|
inline |
Provides access to the underlying C instance.
ClutterColor* Clutter::Color::gobj_copy | ( | ) | const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
Interpolates between this initial color and a final color.
- Parameters
-
The interpolation progress.
void Clutter::Color::lighten | ( | ) |
Lightens color by a fixed amount, and saves the changed color in result.
- Parameters
-
result Return location for the lighter color.
void Clutter::Color::set_alpha | ( | const guint8 & | value) |
void Clutter::Color::set_blue | ( | const guint8 & | value) |
void Clutter::Color::set_from_hls | ( | float | hue, |
float | luminance, | ||
float | saturation | ||
) |
Converts a color expressed in HLS (hue, luminance and saturation) values into a Clutter::Color.
- Parameters
-
hue Hue value, in the 0 .. 360 range. luminance Luminance value, in the 0 .. 1 range. saturation Saturation value, in the 0 .. 1 range.
void Clutter::Color::set_from_pixel | ( | guint32 | pixel) |
Converts pixel from the packed representation of a four 8 bit channel color to a Clutter::Color.
- Parameters
-
pixel A 32 bit packed integer containing a color.
void Clutter::Color::set_from_rgb | ( | guint8 | red, |
guint8 | blue, | ||
guint8 | green | ||
) |
void Clutter::Color::set_from_string | ( | const Glib::ustring & | color) |
void Clutter::Color::set_green | ( | const guint8 & | value) |
void Clutter::Color::set_red | ( | const guint8 & | value) |
void Clutter::Color::shade | ( | double | shade) |
Shades color by factor and saves the modified color into result.
- Parameters
-
factor The shade factor to apply. result Return location for the shaded color.
Subtracts b from a and saves the resulting color inside result.
This function assumes that the components of a are greater than the components of b; the result is, otherwise, undefined.
The alpha channel of result is set as the minimum value between the alpha channels of a and b.
- Parameters
-
b A Clutter::Color. result Return location for the result.
void Clutter::Color::swap | ( | Color& | other) |
void Clutter::Color::to_hls | ( | float & | hue, |
float & | luminance, | ||
float & | saturation | ||
) | const |
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.
- Parameters
-
hue Return location for the hue value or 0
.luminance Return location for the luminance value or 0
.saturation Return location for the saturation value or 0
.
guint32 Clutter::Color::to_pixel | ( | ) | const |
Converts color into a packed 32 bit integer, containing all the four 8 bit channels used by Clutter::Color.
- Returns
- A packed color.
Glib::ustring Clutter::Color::to_string | ( | ) | const |
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.
- Returns
- A newly-allocated text string.
Friends And Related Function Documentation
- Parameters
-
lhs The left-hand side rhs The right-hand side
- Returns
- The result
- Returns
- the sum of color1 and color2
- Returns
- the color resulting from subtracting color2 from color1
- Parameters
-
lhs The left-hand side rhs The right-hand side
- Returns
- The result
- Parameters
-
lhs The left-hand side rhs The right-hand side
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns
- A C++ instance that wraps this C instance.
Member Data Documentation
|
protected |
The documentation for this class was generated from the following file:
- cluttermm/color.h