|
gtkmm
3.22.1
|
Gdk::Color is used to describe an allocated or unallocated color. More...
#include <gdkmm/color.h>
Public Member Functions | |
| Color (GdkColor* gobject, bool make_a_copy=true) | |
| Color (const Color& other) | |
| Color& | operator= (const Color& other) |
| Color (Color&& other) noexcept | |
| Color& | operator= (Color&& other) noexcept |
| ~Color () noexcept | |
| void | swap (Color& other) noexcept |
| GdkColor* | gobj () |
| Provides access to the underlying C instance. More... | |
| const GdkColor* | gobj () const |
| Provides access to the underlying C instance. More... | |
| GdkColor* | 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 () | |
| Instantiate a new Gdk::Color. More... | |
| Color (const Glib::ustring& value) | |
| Instantiate a new Gdk::Color. More... | |
| void | set_grey (gushort value) |
| Set a grey color, by using the same value for all color components. More... | |
| void | set_grey_p (double g) |
| Set a grey color, by using the same value for all color components. More... | |
| void | set_rgb (gushort red_, gushort green_, gushort blue_) |
| Set the color, by specifying red, green, and blue color component values. More... | |
| void | set_rgb_p (double red_, double green_, double blue_) |
| Set the color, by specifying red, green, and blue color component values, as fractions. More... | |
| void | set_hsv (double h, double s, double v) |
| Set the color, by specifying hue, saturation, and value (brightness). More... | |
| void | set_hsl (double h, double s, double l) |
| Set the color, by specifying hue, saturation, and lightness. More... | |
| bool | set (const Glib::ustring& value) |
| Parses a textual specification of a color and fills in the red, green, and blue values. More... | |
| gushort | get_red () const |
| Get the red component of the color. More... | |
| gushort | get_green () const |
| Get the green component of the color. More... | |
| gushort | get_blue () const |
| Get the blue component of the color. More... | |
| void | set_red (gushort value) |
| Set the red component of the color. More... | |
| void | set_green (gushort value) |
| Set the green component of the color. More... | |
| void | set_blue (gushort value) |
| Set the blue component of the color. More... | |
| guint | get_pixel () const |
| Get the pixel value, for allocated colors. More... | |
| double | get_red_p () const |
| Get the red component of the color, as a fraction. More... | |
| double | get_green_p () const |
| Get the green component of the color, as a fraction. More... | |
| double | get_blue_p () const |
| Get the blue component of the color, as a fraction. More... | |
| Glib::ustring | to_string () const |
| Get a textual specification of color in the hexadecimal form #rrrrggggbbbb, where r, g and b are hex digits representing the red, green and blue components respectively. More... | |
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 | |
| GdkColor* | gobject_ |
Related Functions | |
(Note that these are not member functions.) | |
| bool | operator== (const Color& lhs, const Color& rhs) |
| bool | operator!= (const Color& lhs, const Color& rhs) |
| void | swap (Color& lhs, Color& rhs) noexcept |
| Gdk::Color | wrap (GdkColor* object, bool take_copy=false) |
| A Glib::wrap() method for this object. More... | |
Gdk::Color is used to describe an allocated or unallocated color.
It contains the following data:
|
explicit |
| Gdk::Color::Color | ( | const Color& | other | ) |
|
noexcept |
|
noexcept |
| Gdk::Color::Color | ( | ) |
Instantiate a new Gdk::Color.
You should then use the set methods.
|
explicit |
Instantiate a new Gdk::Color.
The text string can be in any of the forms accepted by XParseColor; these include names for a color from rgb.txt, such as DarkSlateGray, or a hex specification such as 305050.
| value | the string specifying the color. |
| gushort Gdk::Color::get_blue | ( | ) | const |
Get the blue component of the color.
| double Gdk::Color::get_blue_p | ( | ) | const |
Get the blue component of the color, as a fraction.
| gushort Gdk::Color::get_green | ( | ) | const |
Get the green component of the color.
| double Gdk::Color::get_green_p | ( | ) | const |
Get the green component of the color, as a fraction.
| guint Gdk::Color::get_pixel | ( | ) | const |
Get the pixel value, for allocated colors.
| gushort Gdk::Color::get_red | ( | ) | const |
Get the red component of the color.
| double Gdk::Color::get_red_p | ( | ) | const |
Get the red component of the color, as a fraction.
|
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.
| GdkColor* Gdk::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.
| bool Gdk::Color::set | ( | const Glib::ustring & | value | ) |
Parses a textual specification of a color and fills in the red, green, and blue values.
The text string can be in any of the forms accepted by XParseColor; these include names for a color from rgb.txt, such as DarkSlateGray, or a hex specification such as 305050.
| value | the string specifying the color. |
| void Gdk::Color::set_blue | ( | gushort | value | ) |
Set the blue component of the color.
| value | The blue component of the color. |
| void Gdk::Color::set_green | ( | gushort | value | ) |
Set the green component of the color.
| value | The green component of the color. |
| void Gdk::Color::set_grey | ( | gushort | value | ) |
Set a grey color, by using the same value for all color components.
| value | The value to be used for the red, green, and blue components. |
| void Gdk::Color::set_grey_p | ( | double | g | ) |
Set a grey color, by using the same value for all color components.
| g | The value to be used for the red, green, and blue components, as a fraction. |
| void Gdk::Color::set_hsl | ( | double | h, |
| double | s, | ||
| double | l | ||
| ) |
Set the color, by specifying hue, saturation, and lightness.
| h | Hue, in the range 0..360 degrees. |
| s | Saturation, in the range 0..1. |
| l | Lightness, in the range 0..1. |
| void Gdk::Color::set_hsv | ( | double | h, |
| double | s, | ||
| double | v | ||
| ) |
Set the color, by specifying hue, saturation, and value (brightness).
| h | Hue, in the range 0..360 degrees. |
| s | Saturation, in the range 0..1. |
| v | Value (a.k.a. brightness), in the range 0..1. |
| void Gdk::Color::set_red | ( | gushort | value | ) |
Set the red component of the color.
| value | The red component of the color. |
| void Gdk::Color::set_rgb | ( | gushort | red_, |
| gushort | green_, | ||
| gushort | blue_ | ||
| ) |
Set the color, by specifying red, green, and blue color component values.
| red_ | The red component of the color. |
| green_ | The green component of the color. |
| blue_ | The blue component of the color. |
| void Gdk::Color::set_rgb_p | ( | double | red_, |
| double | green_, | ||
| double | blue_ | ||
| ) |
Set the color, by specifying red, green, and blue color component values, as fractions.
| red_ | The red component of the color, as a fraction. |
| green_ | The green component of the color, as a fraction. |
| blue_ | The blue component of the color, as a fraction. |
|
noexcept |
| Glib::ustring Gdk::Color::to_string | ( | ) | const |
Get a textual specification of color in the hexadecimal form #rrrrggggbbbb, where r, g and b are hex digits representing the red, green and blue components respectively.
| lhs | The left-hand side |
| rhs | The right-hand side |
| lhs | The left-hand side |
| rhs | The right-hand side |
| lhs | The left-hand side |
| rhs | The right-hand side |
|
related |
A Glib::wrap() method for this object.
| 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. |
|
protected |
1.8.13