Package: gdk

Function gdk-rgba-to-string

Lambda List

gdk-rgba-to-string (color)

Arguments

color -- a gdk-rgba color

Return Value

A string with the textual specification of color.

Details

Returns a textual specification of color 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 represented as integers in the range 0 to 255, and a is represented as a floating point value in the range 0.0 to 1.0.

These string forms are supported by the CSS3 colors module, and can be parsed by the function gdk-rgba-parse.

Note that this string representation may loose some precision, since r, g and b are represented as 8-bit integers. If this is a concern, you should use a different representation.

Example

(gdk-rgba-to-string (gdk-rgba-new :red 1.0))
=> "rgba(255,0,0,0)"
(gdk-rgba-parse *)
=> #S(GDK-RGBA :RED 1.0d0 :GREEN 0.0d0 :BLUE 0.0d0 :ALPHA 0.0d0)    
 

See also

*2021-1-24