pade SciMax Toolbox parGosper

SciMax Toolbox >> palette

palette

Graphic option

palette

Description

Default value: color

palette indicates how to map the real values of a matrix passed to object image onto color components.

palette is a vector of length three with components ranging from -36 to +36; each value is an index for a formula mapping the levels onto red, green and blue colors, respectively:

0: 0               1: 0.5           2: 1
3: x               4: x^2           5: x^3
6: x^4             7: sqrt(x)       8: sqrt(sqrt(x))
9: sin(90x)       10: cos(90x)     11: |x-0.5|
12: (2x-1)^2       13: sin(180x)    14: |cos(180x)|
15: sin(360x)      16: cos(360x)    17: |sin(360x)|
18: |cos(360x)|    19: |sin(720x)|  20: |cos(720x)|
21: 3x             22: 3x-1         23: 3x-2
24: |3x-1|         25: |3x-2|       26: (3x-1)/2
27: (3x-2)/2       28: |(3x-1)/2|   29: |(3x-2)/2|
30: x/0.32-0.78125 31: 2*x-0.84     32: 4x;1;-2x+1.84;x/0.08-11.5
33: |2*x - 0.5|    34: 2*x          35: 2*x - 0.5
36: 2*x - 1

negative numbers mean negative colour component.

palette = gray and palette = color are short cuts for palette = [3,3,3] and palette = [7,5,15], respectively.

Since this is a global graphics option, its position in the scene description does not matter.

Examples:

(%i1) load(draw)$
(%i2) im: apply(
           'matrix,
            makelist(makelist(random(200),i,1,30),i,1,30))$
(%i3) /* palette = color, default */
      draw2d(image(im,0,0,30,30))$
(%i4) draw2d(palette = gray, image(im,0,0,30,30))$
(%i5) draw2d(palette = [15,20,-4],
             colorbox=false,
             image(im,0,0,30,30))$

See also .

pade SciMax Toolbox parGosper