palette-randomize-a!

Synopsis

(palette-randomize-a! palette number)

Parameters

  • palette: A colormap with dimensions 65536x1 or 256x256
  • number: The total number of randomized areas

Description

This procedure is similar to palette-radomize-c!, but specifying an intended number of evently distributed areas. Therefore, there’s a logical minimum of 1.

Side Effects

The palette colormap is changed.

Return Value

The palette colormap is returned and ready for interpolation.

Example

> (define palette (palette-create))
palette
> (palette-randomize-a! palette 10)
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:65536 h:1>
> (palette-writepng palette "palette-rnd-areas.png")
ok
> (palette-interpolate! palette)
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:256 h:256>
> (palette-writepng palette "palette-rnd-areas-ip.png")
ok
>

The resulting palette displays as follows (note the pixels): palette-rnd-areas.png

After linear interpolation this palette then displays as follows: palette-rnd-areas-ip.png