colormap_complex package

colormap_complex.colormap(*, type: Literal['oklab', 'oklch', 'prolab', 'prolch', 'hsv', 'ycbcr', 'bremm', 'cubediagonal', 'schumann', 'steiger', 'teulingfig2', 'ziegler'] = 'bremm', cut_outbound: bool = True, clip: bool = True) Colormap[source]

2D colormap function.

Parameters:
  • type (Literal['oklab', 'oklch', 'prolab', 'prolch', 'hsv', 'ycbcr',) – ‘bremm’, ‘cubediagonal’, ‘schumann’, ‘steiger’, ‘teulingfig2’, ‘ziegler’] Type of colormap.

  • cut_outbound (bool) – If using CIE XYZ, cut colors that are out of bounds for the sRGB color space.

  • clip (bool) – Whether to clip the output to the range [0, 1].

Returns:

Colormap function.

Return type:

Colrmap

colormap_complex.interpnd(base: ndarray[Any, dtype[TBase]], *indices: ndarray[Any, dtype[number]]) ndarray[Any, dtype[TBase]][source]

Interpolate a n-dimensional array.

Parameters:
  • base (NDArray[TBase]) – Array of shape B.

  • indices (NDArray[np.number]) – Array of shape I.

Returns:

Interpolated array of shape (*I, B.shape[len(I):]).

Return type:

NDArray[TBase]

Submodules

colormap_complex.matplotlib module

colormap_complex.matplotlib.get_mpl_1d_colormap(colormap: Colormap, v: float, /, axis: Literal[0, 1] = 0, N: int = 128) ListedColormap[source]

Get a matplotlib colormap from a function.

Parameters:
  • colormap (Callable[[NDArray[np.number]], NDArray[np.number]]) – The colormap function to use.

  • v (float) – The value to use for the colormap.

  • axis (Literal[0, 1]) – The axis to take the colormap from.

  • N (int) – The number of colors in the colormap.

Returns:

Matplotlib colormap.

Return type:

BivarColormapFromImage

colormap_complex.matplotlib.get_mpl_colormap(colormap: Colormap, /, N: int = 128, M: int = 128) BivarColormapFromImage[source]

Get a matplotlib colormap from a function.

Parameters:
  • colormap (Colormap) – The colormap function to use.

  • N (int) – The number of colors in the x axis.

  • M (int) – The number of colors in the y axis.

Returns:

Matplotlib colormap.

Return type:

BivarColormapFromImage