-
Notifications
You must be signed in to change notification settings - Fork 26
Color
Alessandro Febretti edited this page Jun 21, 2013
·
3 revisions
wraps omega:Color
A Color object stores an RGBA representation of a color. Colors can be constructed using a color name, an exadecimal value or four floating point values. The following are all examples of correct colors:
c1 = Color('red')
c2 = Color('#ff0000ff')
c3 = Color(1, 0, 0, 1)
The exadecimal representation of a color may or may not specify the alpha component. Color('#ff0000')
and Color('#ff0000ff')
are both valid. When no alpha component is specified, it is set to ff
by default.
When using a named color, valid color names (and corresponding RGB values) are as follows (color names are case insensitive):
Color Name | Color Value |
---|---|
White | Color(1.0f, 1.0f, 1.0f) |
Black | Color(0.0f, 0.0f, 0.0f) |
Orange | Color(1.0f, 0.65f, 0.0f) |
Silver | Color(0.75f, 0.75f, 0.75f) |
Gray | Color(0.5f, 0.5f, 0.5f) |
Red | Color(1.0f, 0.0f, 0.0f) |
Maroon | Color(0.5f, 0.0f, 0.0f) |
Yellow | Color(1.0f, 1.0f, 0.0f) |
Olive | Color(0.5f, 0.5f, 0.0f) |
Lime | Color(0.2f, 1.0f, 0.0f) |
Green | Color(0.0f, 1.0f, 0.0f) |
Aqua | Color(0.0f, 1.0f, 1.0f) |
Teal | Color(0.0f, 0.5f, 0.5f) |
Blue | Color(0.0f, 0.0f, 1.0f) |
Navy | Color(0.0f, 0.0f, 0.5f) |
Fuchsia | Color(1.0f, 0.0f, 1.0f) |
Purple | Color(0.5f, 0.0f, 0.5f) |