cube
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 :meth:~palettes.Palette.color_name.
Example
from palettes import get_palette palette = get_palette(name="cube", size=5, color_depth=16) len(palette) 125
CubePalette(name='', color_depth=16, swapped=False, cached=True, size=5)
Bases: Palette
Evenly spaced RGB cube palette.
Indices traverse the cube in x, then y, then z order. Channel
values are spaced from 0 to 255 inclusive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Prefix for :attr: |
''
|
|
color_depth
|
Output format; see :class: |
16
|
|
swapped
|
Byte-swap 16-bit colors when |
False
|
|
cached
|
Memoize index lookups when |
True
|
|
size
|
Cube edge length. Must be |
5
|