Colors¶
tinytopics.colors
¶
pal_tinytopics(format='hex')
¶
The tinytopics 10 color palette.
A rearranged version of the original Observable 10 palette.
Reordered to align with the color ordering of the D3 Category 10 palette,
also known as matplotlib.cm.tab10
.
The rearrangement aims to improve perceptual familiarity and color harmony,
especially when used in a context where color interpolation is needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
format
|
ColorFormat
|
Returned color format. Options are:
|
'hex'
|
Returns:
Type | Description |
---|---|
MutableSequence[str] | NDArray[float64]
|
|
MutableSequence[str] | NDArray[float64]
|
|
MutableSequence[str] | NDArray[float64]
|
|
Raises:
Type | Description |
---|---|
ValueError
|
If format is not 'hex', 'rgb', or 'lab'. |
scale_color_tinytopics(n)
¶
A tinytopics 10 color scale. If > 10 colors are required, will generate an interpolated color palette based on the 10-color palette in the CIELAB color space using B-splines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
int
|
The number of colors needed. |
required |
Returns:
Type | Description |
---|---|
ListedColormap
|
A colormap with n colors, possibly interpolated from the 10 colors. |