Package: gdk

Function gdk-rgba-parse

Lambda List

gdk-rgba-parse (spec)


spec -- the string specifying the color

Return Value

A gdk-rgba structure with the filled in values.


Parses a textual representation of a color, and returns a rgba structure filling in the red, green, blue and alpha fields.

The string can be either one of:
  • A standard name taken from the X11 rgb.txt file.
  • A hex value in the form rgb, rrggbb, rrrgggbbb or rrrrggggbbbb.
  • A RGB color in the form rgb(r,g,b). In this case the color will have full opacity.
  • A RGBA color in the form rgba(r,g,b,a).
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.

Since 3.0

See also