![]() |
![]() |
![]() |
GDK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gdk/gdk.h> GdkRGBA; GdkRGBA * gdk_rgba_copy (GdkRGBA *rgba
); void gdk_rgba_free (GdkRGBA *rgba
); gboolean gdk_rgba_parse (GdkRGBA *rgba
,const gchar *spec
); gboolean gdk_rgba_equal (gconstpointer p1
,gconstpointer p2
); guint gdk_rgba_hash (gconstpointer p
); gchar * gdk_rgba_to_string (const GdkRGBA *rgba
);
GdkRGBA * gdk_rgba_copy (GdkRGBA *rgba
);
Makes a copy of a GdkRGBA structure, the result must be freed
through gdk_rgba_free()
.
Since 3.0
void gdk_rgba_free (GdkRGBA *rgba
);
Frees a GdkRGBA struct created with gdk_rgba_copy()
|
a GdkRGBA |
Since 3.0
gboolean gdk_rgba_parse (GdkRGBA *rgba
,const gchar *spec
);
Parses a textual representation of a color, filling in
the red
, green
,
blue
and alpha
fields of the rgba
struct.
The string can be either one of:
Where 'r', 'g', 'b' and 'a' are respectively the red, green, blue and alpha color values. In the last two cases, r g and b are either integers in the range 0 to 255 or precentage values in the range 0% to 100%, and a is a floating point value in the range 0 to 1.
|
the GdkRGBA struct to fill in |
|
the string specifying the color |
Returns : |
TRUE if the parsing succeeded
|
Since 3.0
gboolean gdk_rgba_equal (gconstpointer p1
,gconstpointer p2
);
Compares two RGBA colors.
|
a GdkRGBA pointer. |
|
another GdkRGBA pointer. |
Returns : |
TRUE if the two colors compare equal
|
Since 3.0
guint gdk_rgba_hash (gconstpointer p
);
A hash function suitable for using for a hash table that stores GdkRGBAs.
|
a GdkRGBA pointer. |
Returns : |
The hash function applied to p
|
Since 3.0
gchar * gdk_rgba_to_string (const GdkRGBA *rgba
);
Returns a textual specification of rgba
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. r, g, and b are integers in the range 0 to 255, and a
is a floating point value in the range 0 to 1.
(These string forms are string forms those supported by the CSS3 colors module)
|
a GdkRGBA |
Returns : |
A newly allocated text string |
Since 3.0