| Top |
| CdkColor * | cdk_color_copy () |
| void | cdk_color_free () |
| gboolean | cdk_color_parse () |
| gboolean | cdk_color_equal () |
| guint | cdk_color_hash () |
| gchar * | cdk_color_to_string () |
A CdkColor represents a color.
When working with cairo, it is often more convenient to use a CdkRGBA instead.
CdkColor *
cdk_color_copy (const CdkColor *color);
Makes a copy of a CdkColor.
The result must be freed using cdk_color_free().
void
cdk_color_free (CdkColor *color);
Frees a CdkColor created with cdk_color_copy().
gboolean cdk_color_parse (const gchar *spec,CdkColor *color);
Parses a textual specification of a color and fill in the
red
, green
, and blue
fields of a CdkColor.
The string can either one of a large set of standard names
(taken from the X11 rgb.txt file), or it can be a hexadecimal
value in the form “#rgb” “#rrggbb”, “#rrrgggbbb” or
“#rrrrggggbbbb” where “r”, “g” and “b” are hex digits of
the red, green, and blue components of the color, respectively.
(White in the four forms is “#fff”, “#ffffff”, “#fffffffff”
and “#ffffffffffff”).
gboolean cdk_color_equal (const CdkColor *colora,const CdkColor *colorb);
Compares two colors.
guint
cdk_color_hash (const CdkColor *color);
A hash function suitable for using for a hash table that stores CdkColors.
gchar *
cdk_color_to_string (const CdkColor *color);
Returns 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.
The returned string can be parsed by cdk_color_parse().
Since: 2.12
typedef struct {
guint32 pixel;
guint16 red;
guint16 green;
guint16 blue;
} CdkColor;
A CdkColor is used to describe a color, similar to the XColor struct used in the X11 drawing API.