
@c %start of fragment

@deffn Function clutter-color-new  (red@tie{}@code{unsigned-int8}) (green@tie{}@code{unsigned-int8}) (blue@tie{}@code{unsigned-int8}) (alpha@tie{}@code{unsigned-int8}) @result{}@tie{} (ret@tie{}@code{<clutter-color>})
Creates a new @code{<clutter-color>} with the given values.

@table @var
@item red
red component of the color, between 0 and 255

@item green
green component of the color, between 0 and 255

@item blue
blue component of the color, between 0 and 255

@item alpha
alpha component of the color, between 0 and 255

@item ret
the newly allocated color. Use @code{clutter-color-free} when done.

@end table

Since 0.8.4

@end deffn

@deffn Function clutter-color-get-static  (color@tie{}@code{<clutter-static-color>}) @result{}@tie{} (ret@tie{}@code{<clutter-color>})
Retrieves a static color for the given @var{color} name

Static colors are created by Clutter and are guaranteed to always be
available and valid

@table @var
@item color
the named global color

@item ret
a pointer to a static color; the returned pointer is owned by Clutter
and it should never be modified or freed

@end table

Since 1.6

@end deffn

@deffn Function clutter-color-from-string  (name@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{scm})
Parses a string definition of a color, filling the @c (structfield
"red") , @c (structfield "green") , @c (structfield "blue") and @c
(structfield "alpha") channels of @var{color}.

The @var{color} is not allocated.

The format of @var{str} can be either one of:

@itemize 
@item
@item
@item
@item
@item
@item
@end itemize

a standard name (as taken from the X11 rgb.txt file)

an hexadecimal value in the form: @samp{&#x0023;rgb},
@samp{&#x0023;rrggbb}, @samp{&#x0023;rgba} or @samp{&#x0023;rrggbbaa}

a RGB color in the form: @samp{rgb(r, g, b)}

a RGB color in the form: @samp{rgba(r, g, b, a)}

a HSL color in the form: @samp{hsl(h, s, l)}

a HSL color in the form: @samp{hsla(h, s, l, a)}

where 'r', 'g', 'b' and 'a' are (respectively) the red, green, blue
color intensities and the opacity. The 'h', 's' and 'l' are
(respectively) the hue, saturation and luminance values.

In the @code{rgb} and @code{rgba} formats, the 'r', 'g', and 'b' values
are either integers between 0 and 255, or percentage values in the range
between 0% and 100%; the percentages require the '%' character. The 'a'
value, if specified, can only be a floating point value between 0.0 and
1.0.

In the @code{hls} and @code{hlsa} formats, the 'h' value (hue) it's an
angle between 0 and 360.0 degrees; the 'l' and 's' values (luminance and
saturation) are a floating point value between 0.0 and 1.0. The 'a'
value, if specified, can only be a floating point value between 0.0 and
1.0.

Whitespace inside the definitions is ignored; no leading whitespace is
allowed.

If the alpha component is not specified then it is assumed to be set to
be fully opaque.

@table @var
@item color
return location for a @code{<clutter-color>}.

@item str
a string specifiying a color

@item ret
@samp{@code{#t}} if parsing succeeded, and @samp{@code{#f}} otherwise

@end table

Since 1.0

@end deffn

@deffn Function clutter-color-to-string  (self@tie{}@code{<clutter-color>}) @result{}@tie{} (ret@tie{}@code{mchars})
Returns a textual specification of @var{color} in the hexadecimal form
@samp{&#x0023;rrggbbaa}, where @samp{r}, @samp{g}, @samp{b} and @samp{a}
are hexadecimal digits representing the red, green, blue and alpha
components respectively.

@table @var
@item color
a @code{<clutter-color>}

@item ret
a newly-allocated text string.

@end table

Since 0.2

@end deffn

@deffn Function clutter-color-from-hls  (self@tie{}@code{<clutter-color>}) (hue@tie{}@code{float}) (luminance@tie{}@code{float}) (saturation@tie{}@code{float})
Converts a color expressed in HLS (hue, luminance and saturation) values
into a @code{<clutter-color>}.

@table @var
@item color
return location for a @code{<clutter-color>}.

@item hue
hue value, in the 0 .. 360 range

@item luminance
luminance value, in the 0 .. 1 range

@item saturation
saturation value, in the 0 .. 1 range

@end table

@end deffn

@deffn Function clutter-color-to-hls  (self@tie{}@code{<clutter-color>}) @result{}@tie{} (hue@tie{}@code{float}) (luminance@tie{}@code{float}) (saturation@tie{}@code{float})
Converts @var{color} to the HLS format.

The @var{hue} value is in the 0 .. 360 range. The @var{luminance} and
@var{saturation} values are in the 0 .. 1 range.

@table @var
@item color
a @code{<clutter-color>}

@item hue
return location for the hue value or @samp{@code{#f}}.

@item luminance
return location for the luminance value or @samp{@code{#f}}.

@item saturation
return location for the saturation value or @samp{@code{#f}}.

@end table

@end deffn

@deffn Function clutter-color-from-pixel  (self@tie{}@code{<clutter-color>}) (pixel@tie{}@code{unsigned-int32})
Converts @var{pixel} from the packed representation of a four 8 bit
channel color to a @code{<clutter-color>}.

@table @var
@item color
return location for a @code{<clutter-color>}.

@item pixel
a 32 bit packed integer containing a color

@end table

@end deffn

@deffn Function clutter-color-to-pixel  (self@tie{}@code{<clutter-color>}) @result{}@tie{} (ret@tie{}@code{unsigned-int32})
Converts @var{color} into a packed 32 bit integer, containing all the
four 8 bit channels used by @code{<clutter-color>}.

@table @var
@item color
a @code{<clutter-color>}

@item ret
a packed color

@end table

@end deffn

@deffn Function clutter-color-add  (self@tie{}@code{<clutter-color>}) (b@tie{}@code{<clutter-color>}) (result@tie{}@code{<clutter-color>})
Adds @var{a} to @var{b} and saves the resulting color inside
@var{result}.

The alpha channel of @var{result} is set as as the maximum value between
the alpha channels of @var{a} and @var{b}.

@table @var
@item a
a @code{<clutter-color>}

@item b
a @code{<clutter-color>}

@item result
return location for the result.

@end table

@end deffn

@deffn Function clutter-color-subtract  (self@tie{}@code{<clutter-color>}) (b@tie{}@code{<clutter-color>}) (result@tie{}@code{<clutter-color>})
Subtracts @var{b} from @var{a} and saves the resulting color inside
@var{result}.

This function assumes that the components of @var{a} are greater than
the components of @var{b}; the result is, otherwise, undefined.

The alpha channel of @var{result} is set as the minimum value between
the alpha channels of @var{a} and @var{b}.

@table @var
@item a
a @code{<clutter-color>}

@item b
a @code{<clutter-color>}

@item result
return location for the result.

@end table

@end deffn

@deffn Function clutter-color-lighten  (self@tie{}@code{<clutter-color>}) (result@tie{}@code{<clutter-color>})
Lightens @var{color} by a fixed amount, and saves the changed color in
@var{result}.

@table @var
@item color
a @code{<clutter-color>}

@item result
return location for the lighter color.

@end table

@end deffn

@deffn Function clutter-color-darken  (self@tie{}@code{<clutter-color>}) (result@tie{}@code{<clutter-color>})
Darkens @var{color} by a fixed amount, and saves the changed color in
@var{result}.

@table @var
@item color
a @code{<clutter-color>}

@item result
return location for the darker color.

@end table

@end deffn

@deffn Function clutter-color-shade  (self@tie{}@code{<clutter-color>}) (factor@tie{}@code{double}) (result@tie{}@code{<clutter-color>})
Shades @var{color} by @var{factor} and saves the modified color into
@var{result}.

@table @var
@item color
a @code{<clutter-color>}

@item factor
the shade factor to apply

@item result
return location for the shaded color.

@end table

@end deffn

@deffn Function clutter-color-interpolate  (self@tie{}@code{<clutter-color>}) (final@tie{}@code{<clutter-color>}) (progress@tie{}@code{double}) (result@tie{}@code{<clutter-color>})
Interpolates between @var{initial} and
@var{final}@code{<clutter-color>}s using @var{progress}

@table @var
@item initial
the initial @code{<clutter-color>}

@item final
the final @code{<clutter-color>}

@item progress
the interpolation progress

@item result
return location for the interpolation.

@end table

Since 1.6

@end deffn

@deffn Function clutter-value-set-color  (value@tie{}@code{<gvalue>}) (color@tie{}@code{<clutter-color>})
Sets @var{value} to @var{color}.

@table @var
@item value
a @code{<gvalue>} initialized to @code{<clutter-type-color>}

@item color
the color to set

@end table

Since 0.8.4

@end deffn

@deffn Function clutter-value-get-color  (value@tie{}@code{<gvalue>}) @result{}@tie{} (ret@tie{}@code{<clutter-color>})
Gets the @code{<clutter-color>} contained in @var{value}.

@table @var
@item value
a @code{<gvalue>} initialized to @code{<clutter-type-color>}

@item ret
the color inside the passed @code{<gvalue>}.

@end table

Since 0.8.4

@end deffn


@c %end of fragment
