galactic.algebras.lattice.examples.color.core#
Defines a simple partially ordered set of colors.
Classes
Colorwhich represents partially comparable colors
- class Color(red=0.0, green=0.0, blue=0.0)#
Bases:
ElementRepresents colors in a partial order.
The relation \((r_a, g_a, b_a) \leq (r_b, g_b, b_b)\) is equivalent to \(r_a \leq r_b \wedge g_a \leq g_b \wedge b_a \leq b_b\).
- Parameters:
red (
SupportsFloat, default:0.0) β The red component.green (
SupportsFloat, default:0.0) β The green component.blue (
SupportsFloat, default:0.0) β The blue component.
- Raises:
ValueError β If a color component is not between 0 and 1.
Examples
- property red: float#
Return the red component of the color.
- Returns:
The red component.
- Return type:
- property green: float#
Return the green component of the color.
- Returns:
The green component.
- Return type: