pyvista.LookupTable.map_value

pyvista.LookupTable.map_value#

LookupTable.map_value(
value: float,
opacity: bool = True,
) tuple[float, float, float] | tuple[float, float, float, float][source]#

Map a single value through the lookup table, returning an RBG(A) color.

Parameters:
valuefloat

Scalar value to map to an RGB(A) color.

opacitybool, default: True

Map the opacity as well.

Returns:
tuple

Mapped RGB(A) color.

Examples

>>> import pyvista as pv
>>> lut = pv.LookupTable()
>>> rgba_color = lut.map_value(0.0)
>>> rgba_color
(1.0, 0.0, 0.0, 1.0)