Packages
clutter-1.0
Clutter
Color
alloc
get_static
Color.from_hls
Color.from_pixel
Color.from_string
add
copy
darken
equal
free
hash
init
interpolate
lighten
parse_string
shade
subtract
to_hls
to_pixel
to_string
alpha
blue
green
red
Stays crunchy ...
... even in milk.
Valadoc
Vala
Tutorial
Vala Journal
API-References
Markup
About
Color
Object Hierarchy:
Description:
public
struct
Color
Color representation.
Namespace:
Clutter
Package:
clutter-1.0
Content:
Static methods:
public
static
Color
alloc
()
Allocates a new, transparent black
Color
.
public
static
Color
get_static
(
StaticColor
color)
Retrieves a static color for the given
color
name
Creation methods:
public
Color.from_hls
(
float
hue,
float
luminance,
float
saturation)
Converts a color expressed in HLS (hue, luminance and saturation) values into a
Color
.
public
Color.from_pixel
(
uint32
pixel)
Converts
pixel
from the packed representation of a four 8 bit channel color to a
Color
.
public
Color.from_string
(
string
str)
Parses a string definition of a color, filling the
red
,
green
,
blue
and
alpha
channels of
color
.
Methods:
public
Color
add
(
Color
b)
Adds
a
to
b
and saves the resulting color inside
result
.
public
Color
copy
()
Makes a copy of the color structure.
public
Color
darken
()
Darkens
color
by a fixed amount, and saves the changed color in
result
.
public
bool
equal
(
Color
v2)
Compares two
Color
s and checks if they are the same.
public
void
free
()
Frees a color structure created with
copy
.
public
uint
hash
()
Converts a
Color
to a hash value.
public
Color
init
(
uint8
red,
uint8
green,
uint8
blue,
uint8
alpha)
Initializes
color
with the given values.
public
Color
interpolate
(
Color
final,
double
progress)
Interpolates between
initial
and
final
Color
s using
progress
public
Color
lighten
()
Lightens
color
by a fixed amount, and saves the changed color in
result
.
public
bool
parse_string
(
string
str)
public
Color
shade
(
double
factor)
Shades
color
by
factor
and saves the modified color into
result
.
public
Color
subtract
(
Color
b)
Subtracts
b
from
a
and saves the resulting color inside
result
.
public
void
to_hls
(
out
float
hue,
out
float
luminance,
out
float
saturation)
Converts
color
to the HLS format.
public
uint32
to_pixel
()
Converts
color
into a packed 32 bit integer, containing all the four 8 bit channels used by
Color
.
public
string
to_string
()
Returns a textual specification of
color
in the hexadecimal form
#rrggbbaa
, where
r
,
g
,
b
and
a
are hexadecimal digits representing the red, green, blue and alpha components respectively.
Fields:
public
uint8
red
public
uint8
green
public
uint8
blue
public
uint8
alpha