Skip to content

colormap#reversed

Summary

colormap#reversed returns a map with the texels in reverse order and the same filtering. Use it to reverse the visual direction of a scale.

Syntax

reversed(): Colormap
const reversed = map.reversed();

Returns

Colormap - Cached reversed map with the same width and filter. Reversing it again returns the original object. The call throws if the original has no CPU lookup table.

Example

const map = WasmGPU.color.map.viridis();
const reversed = map.reversed();
console.log(reversed.reversed() === map); // true

See Also