Colormap.__call__ always goes through a 256-entry LUT, so a colormap defined by a function (ColorStops(lut_func=...), e.g. prism, flag, gnuplot, cubehelix) cannot be evaluated exactly at an arbitrary position through the public API. The function itself is only reachable as the private ColorStops._lut_func, and color_stops.stops holds a 256-point sampling of it.
import numpy as np
from cmap import Colormap
cm = Colormap("prism")
x = np.array([0.1234])
print(cm(x)[0, :3])
print(cm.color_stops._call_lut_func(x)[0, :3])
[1. 0.9237 0. ]
[1. 0.9744 0. ]
lut(n) already evaluates the function directly at any n but there's no public entry point for arbitrary x. Either a public read-only ColorStops.lut_func property or an N=None option on Colormap.__call__ that evaluates lut_func when it exists would be nice...
Colormap.__call__always goes through a 256-entry LUT, so a colormap defined by a function (ColorStops(lut_func=...), e.g. prism, flag, gnuplot, cubehelix) cannot be evaluated exactly at an arbitrary position through the public API. The function itself is only reachable as the privateColorStops._lut_func, andcolor_stops.stopsholds a 256-point sampling of it.lut(n)already evaluates the function directly at anynbut there's no public entry point for arbitrary x. Either a public read-onlyColorStops.lut_funcproperty or anN=Noneoption onColormap.__call__that evaluateslut_funcwhen it exists would be nice...