Skip to content

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 str

Returned color format. Options are: hex: Hex strings (default). rgb: Array of RGB values. lab: Array of CIELAB values.

'hex'

Returns:

Type Description
list or ndarray
  • If format='hex', returns a list of hex color strings.
  • If format='rgb', returns an Nx3 numpy array of RGB values.
  • If format='lab', returns an Nx3 numpy array of CIELAB values.

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.