palettes.cube
RGB color-cube palettes.
Samples the RGB cube at evenly spaced points. Supported cube sizes are
2, 3, 4, and 5 (8, 27, 64, or 125 colors). Each size uses a built-in
name table for color_name.
Example
>>> from palettes import get_palette
>>> palette = get_palette(name="cube", size=5, color_depth=16)
>>> len(palette)
125
- class palettes.cube.CubePalette(name='', color_depth=16, swapped=False, cached=True, size=5)[source]
Bases:
PaletteEvenly spaced RGB cube palette.
This palette is useful when you want a finite, evenly distributed set of colors rather than a continuous ramp. It is common for simple color pickers, indicator sets, or status themes where a small number of distinct colors is better than a smooth gradient.
Indices traverse the cube in
x, theny, thenzorder. Channel values are spaced from0to255inclusive.