palette-interpolate!

Synopsis

(palette-interpolate! palette)

Parameters

  • palette: A colormap with dimensions 65536x1 or 256x256

Description

This procedure performs a linear interpolation between all known color entries in a palette.

Side Effects

The palette colormap is changed accordingly by filling all gaps by linear interpolation.

Return Value

The modified palette colormap is also returned.

Example

This example interpolates an empty palette (resulting in a gray gradient from “almost black” to full white):

> (define p (palette-create))
p
> (palette-interpolate! p)
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:65536 h:1>
> (palette-writepng p "interpolated-palette.png")
ok
>

The resulting palette of this example displays as follows (stored with “folded” dimensions 256x256):

interpolated-palette.png