Color: Indexed Palette Addressing#

class irix.Color.Color(*, chamber: Annotated[int, Ge(ge=0), Le(le=4)] = 0, hue: Annotated[int, Ge(ge=0), Le(le=3)] = 3, shade: Annotated[int, Ge(ge=0), Le(le=11)] = 8)#

A color in the Irix palette, addressed by integer chamber, hue, and shade indices.

The palette is organized into five chambers of four hues each, with twelve shades per hue. Colors can be constructed from integer indices or flexible string expressions via new.

This class is hardcoded to be an Irix color specifically, but it could represent any compliant palette – just define your own subclass, where you can easily override the class variables below.

Examples

`py a = (Color.new(1, 0, 1),) b = (Color.new('SLATE-SHEET2'),) c = (Color.new('slate', 0, 1),) assert a == b and b == c `

I Initial Methods#

classmethod Color.new(arg0: str | tuple[int, ...] | int, hue: str | int = 3, shade: int | str = 8) → Self#

Construct a Color from flexible string or numeric arguments.

Parameters:
  • arg0 – Chamber index (int), chamber name (str), hue name (str), 'hue-shade' expression, tuple of indices, or digit string.

  • hue – Hue index (int), hue name (str), or digit string. Ignored when arg0 encodes the full address.

  • shade – Shade index (int), shade name (str), or digit string. Ignored when arg0 encodes the full address.

Returns:

A irix.Color.Color with resolved integer indices.

Raises:

ValueError – If any argument cannot be interpreted as a valid index.

II Public Methods#

property Color.dark: str#

Hex color string in the dark Irix palette.

property Color.light: str#

Hex color string in the light Irix palette.