Package weblogolib :: Module color :: Class Color

Class Color

source code

Color specifications using CSS2 (Cascading Style Sheet) syntax.

http://www.w3.org/TR/REC-CSS2/syndata.html#color-units

Usage:

red = Color(255,0,0)
red = Color(1., 0., 0.)
red = Color.by_name("red")
red = Color.from_rgb(1.,0.,0.)
red = Color.from_rgb(255,0,0)
red = Color.from_hsl(0.,1., 0.5)

red = Color.from_string("red") 
red = Color.from_string("RED") 
red = Color.from_string("#F00") 
red = Color.from_string("#FF0000") 
red = Color.from_string("rgb(255, 0, 0)")
red = Color.from_string("rgb(100%, 0%, 0%)")
red = Color.from_string("hsl(0, 100%, 50%)")

Instance Methods
 
__init__(self, red, green, blue) source code
 
__eq__(self, other) source code
 
__repr__(self) source code
Class Methods
 
from_rgb(cls, r, g, b) source code
 
from_hsl(cls, hue_angle, saturation, lightness) source code
 
from_string(cls, string) source code
Static Methods
 
names()
Return a list of standard color names.
source code
 
by_name(string) source code