%Griffin.jam
%defines the string positioning commands needed by the JaM files that are created by
%the Griffin to JaM converter

(deltax) (.pop .exch .pop .sub).cvx .def
(deltay) (.exch .pop .sub .exch .pop).cvx .def
(topEdge) (0 .fontbox deltay .translate).cvx .def
(flushLeft) ().cvx .def
(flushRight) (.dup .textbox deltax 0 .translate).cvx .def
(centered) (.dup .textbox deltax 2 .div 0 .translate).cvx .def
(docolor) (.hsvcolor).cvx .def
(paleGrey) {0.0 0.0 0.85 docolor} .cvx .def
(darkGrey) (darkGray).cvx .def
(lightGrey) (lightGray).cvx .def
(grey) (gray).cvx .def
(maroon) (darkRed).cvx .def
(darkBrown) {0.075 .5 0.3 docolor} .cvx .def
(brown) {0.075 .5 .5 docolor} .cvx .def
(tan) {.075 .4 .8 docolor} .cvx .def
(darkRed) {0.0 1.0 0.4 docolor} .cvx .def
(lightRed) {0 .5 1 docolor} .cvx .def
(orange) {0.075 1.0 1.0 docolor} .cvx .def
(darkYellow) {.167 1 .5 docolor} .cvx .def
(lightYellow) {0.167 .6 1.0 docolor} .cvx .def
(darkGreen) {0.333 1.0 0.4 docolor} .cvx .def
(lightGreen) {0.333 0.5 1.0 docolor} .cvx .def
(darkBlue) {0.67 1.0 0.5 docolor} .cvx .def
(lightBlue) {0.67 0.4 1.0 docolor} .cvx .def
(darkPurple) {0.776 1 .4 docolor} .cvx .def
(purple) {0.776 1 .8 docolor} .cvx .def
(violet) {0.776 .5 .8 docolor} .cvx .def
(pink) {0.833 0.4 1.0 docolor} .cvx .def
(darkAqua) {0.47 1.0 .4 docolor} .cvx .def
(aqua) {0.47 .7 1.0 docolor} .cvx .def
(darkGray) {0.0 0.0 0.3 docolor} .cvx .def
(lightGray) {0.0 0.0 0.77 docolor} .cvx .def
(black){0 0 0 docolor}.cvx .def
(white){0 0 1 docolor}.cvx .def
(gray){0 0 .5 docolor}.cvx .def
(red){1 0 0 .rgbcolor .hsvfromcolor docolor}.cvx .def
(green){0 1 0 .rgbcolor .hsvfromcolor docolor}.cvx .def
(blue){0 0 1 .rgbcolor .hsvfromcolor docolor}.cvx .def
(magenta){1 0 1 .rgbcolor .hsvfromcolor docolor}.cvx .def
(cyan){0 1 1 .rgbcolor .hsvfromcolor docolor}.cvx .def
(yellow){1 1 0 .rgbcolor .hsvfromcolor docolor}.cvx .def
(griffinmap) (
(docolor) (index 4 1 .roll .sethsvmap (index) index 2 .add .store).cvx .def
(index) 40 .def
paleGrey darkPurple pink darkBrown brown tan darkRed lightRed orange darkYellow
lightYellow darkGreen lightGreen darkBlue lightBlue purple violet pink darkGray lightGray
(docolor) (.hsvcolor .setcolor).cvx .def
).cvx .def
(Griffin.BlackPass) {
(docolor) {
(v) .exch .def
(s) .exch .def
(h) .exch .def
s 0.0 .eq (v .icolor .setcolor).cvx (.white .setcolor).cvx .ifelse
}.cvx .def
}.cvx .def
(Griffin.CyanPass) {
(docolor) {
(v) .exch .def
(s) .exch .def
(h) .exch .def
s 0.0 .eq .not (h s v .hsvcolor .rgbfromcolor .pop .pop .icolor .setcolor).cvx (.white .setcolor).cvx .ifelse
}.cvx .def
}.cvx .def
(Griffin.MagentaPass) {
(docolor) {
(v) .exch .def
(s) .exch .def
(h) .exch .def
s 0.0 .eq .not (h s v .hsvcolor .rgbfromcolor .pop .icolor .setcolor .pop).cvx (.white .setcolor).cvx .ifelse
}.cvx .def
}.cvx .def
(Griffin.YellowPass) {
(docolor) {
(v) .exch .def
(s) .exch .def
(h) .exch .def
s 0.0 .eq .not (h s v .hsvcolor .rgbfromcolor .icolor .setcolor .pop .pop).cvx (.white .setcolor).cvx .ifelse
}.cvx .def
}.cvx .def
(Griffin.FullColor) ((docolor) (.hsvcolor .setcolor).cvx .def).cvx .def
Griffin.FullColor