Next: ClutterContainer, Previous: ClutterCloneTexture, Up: Top
Color management and manipulation.
<clutter-color> is a simple type for representing colors.
mchars) (ret scm)Parses a string definition of a color, filling the (structfield "green") , channels of dest. If alpha is not specified it will be set full opaque. The color in dest is not allocated.
The color may be defined by any of the formats understood by
pango-color-parse; these include literal color names, like ‘Red’ or ‘DarkSlateGray’, or hexadecimal specifications like ‘#3050b2’ or ‘#333’.
- color
- a string specifiying a color (named color or
<rrggbbaa>)- dest
- return location for a
<clutter-color>- ret
- ‘
#t’ if parsing succeeded.Since 0.2
<clutter-color>) (hue unsigned-int8) (luminance unsigned-int8) (saturation unsigned-int8)Converts a color expressed in HLS (hue, luminance and saturation) values into a
<clutter-color>.
- dest
- return location for a
<clutter-color>- hue
- hue value (0 .. 255)
- luminance
- luminance value (0 .. 255)
- saturation
- saturation value (0 .. 255)
<clutter-color>) (pixel unsigned-int32)Converts pixel from the packed representation of a four 8 bit channel color to a
<clutter-color>.
- dest
- return location for a
<clutter-color>- pixel
- a 32 bit packed integer containing a color
<clutter-color>) (src2 <clutter-color>) (dest <clutter-color>)Adds src2 to src1 and saves the resulting color inside dest.
The alpha channel of dest is as the maximum value between the alpha channels of src1 and src2.
- src1
- a
<clutter-color>- src2
- a
<clutter-color>- dest
- return location for the result
<clutter-color>) (src2 <clutter-color>) (dest <clutter-color>)Subtracts src2 from src1 and saves the resulting color inside dest. This function assumes that the components of src1 are greater than the components of src2; the result is, otherwise, undefined.
The alpha channel of dest is set as the minimum value between the alpha channels of src1 and src2.
- src1
- a
<clutter-color>- src2
- a
<clutter-color>- dest
- return location for the result
<clutter-color>) (b <clutter-color>) (ret bool)Compares two
<clutter-color>s and checks if they are the same.
- a
- a
<clutter-color>- b
- a
<clutter-color>- ret
- ‘
#t’ if the two colors are the same.Since 0.2
<clutter-color>) (dest <clutter-color>)Lightens src by a fixed amount, and saves the changed color in dest.
- src
- a
<clutter-color>- dest
- return location for the lighter color
<clutter-color>) (dest <clutter-color>)Darkens src by a fixed amount, and saves the changed color in dest.
- src
- a
<clutter-color>- dest
- return location for the darker color
<clutter-color>) (dest <clutter-color>) (shade double)Shades src by the factor of shade and saves the modified color into dest.
- src
- a
<clutter-color>- dest
- return location for the shaded color
- shade
- the shade factor to apply
<clutter-color>) (hue unsigned-int8) (luminance unsigned-int8) (saturation unsigned-int8)Converts src to the HLS format. Returned HLS values are from interval 0 .. 255.
- src
- a
<clutter-color>- hue
- return location for the hue value or ‘
#f’- luminance
- return location for the luminance value or ‘
#f’- saturation
- return location for the saturation value or ‘
#f’
<clutter-color>) (ret unsigned-int32)Converts src into a packed 32 bit integer, containing all the four 8 bit channels used by
<clutter-color>.
- src
- a
<clutter-color>- ret
- a packed color
<clutter-color>) (ret mchars)Returns a textual specification of color in the hexadecimal form ‘#rrggbbaa’, where ‘r’, ‘g’, ‘b’ and ‘a’ are hex digits representing the red, green, blue and alpha components respectively.
- color
- a
<clutter-color>- ret
- a newly-allocated text string
Since 0.2