Using counting in base 3 to create a palette of 27 colors. The colors in a
GRB palette are closer in value from light to dark than the RGB palette.
Chnanging the shape of the numeric right argument allows different patterns
to be created.

 

load 'viewmat'

f=: 13 :'<.(i.y)*255%<:y'

f 3

f 4

f 5

A=:3 3 3#:i.27

B=:|.A

C=:(3 3 3#:i.27){f 3

RGBPAL27=:|.C

GRBPAL27=:1 0 2{"1 RGBPAL27

A;B;C;RGBPAL27;GRBPAL27

RGBPAL27 viewmat i.27

GRBPAL27 viewmat i.27

GRBPAL27 viewmat i.9 3

GRBPAL27 viewmat i.3 9

 

Linda

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to