Skip to content

wheel

palettes.wheel

HSV and RGB color-wheel palettes.

Build a smooth color wheel or fixed-saturation HSV ramp. Named Windows 16-color attributes (RED, BLACK, etc.) are available on each instance.

Example

from palettes import get_palette palette = get_palette(name="wheel", length=256, saturation=1.0) palette[0] palette.RED

WheelPalette(name='', color_depth=16, swapped=False, cached=True, length=256, saturation=1.0, value=None)

Bases: Palette

Color wheel or HSV ramp palette.

With saturation=None and value=None (the default when both are omitted), indices follow a classic RGB color wheel. When either saturation or value is set, indices map linearly through hue at fixed saturation and value.

Parameters:

Name Type Description Default
name

Prefix for :attr:~palettes.Palette.name (length suffix is added).

''
color_depth

Output format; see :class:~palettes.Palette.

16
swapped

Byte-swap 16-bit colors when True.

False
cached

Memoize index lookups when True (default).

True
length

Number of colors in the wheel (default 256).

256
saturation

HSV saturation in 0.01.0, or None for classic wheel mode.

1.0
value

HSV value in 0.01.0, or None for classic wheel mode.

None

Raises:

Type Description
ValueError

If saturation or value is outside 01 in HSV mode.