Color
Create colors from names, RGB values, and hexadecimal strings.
- class pydraw.color.Color(__name: str)
- class pydraw.color.Color(__rgb: Tuple[int, int, int])
- class pydraw.color.Color(__r: int, __g: int, __b: int)
Bases:
objectAn immutable class that contains a color values, usually by name or RGB.
- NONE
- static all()
Get all color values that have a string-name.
- Returns:
a tuple (immutable list) of all Colors.
- blue()
Get the blue property
- Returns:
b
- clone()
Clone this color!
- Returns:
a clone.
- green()
Get the green property
- Returns:
g
- hex()
Get the hex of the color (only if defined)
- Returns:
hex_value or None
- name()
Get the name of the color (only if defined)
- Returns:
color or None
- static random()
Retrieve a random Color.
- Returns:
returns
- red()
Get the red property.
- Returns:
r
- rgb()
Get the RGB tuple
- Returns:
tuple (R, G, B)