Adobe JS color references - only 16 basic named colours working in my pdf
I have this script setup to trigger on mouse up on a button action in my pdf
The objective is to cycle through 3 colours so people can mark the status of a text field Red Amber or Green (RAG)
This works if I hard code named colors in my events, so I thought I would do the smart thing and declare variables and setup custom colors.
This is not working
var MyCrimson = ["RGB",0.537,0.776,0];
var MyOrange = ["RGB", 0,0,1];
var MyLimegreen = ["RGB", 0,1,0];
if (color.equal(color.MyCrimson, event.target.textColor)) {
event.target.textColor = color.MyOrange;
} else if (color.equal(color.MyOrange, event.target.textColor)) {
event.target.textColor = color.MyLimegreen;
} else event.target.textColor = color.MyCrimson;But this does work (just ugly colors)
if (color.equal(color.red, event.target.textColor)) {
event.target.textColor = color.yellow;
} else if (color.equal(color.yellow, event.target.textColor)) {
event.target.textColor = color.green;
} else event.target.textColor = color.red;Also hard coding the "RGB" values does not work
I'm working (and previewing) on a mac - begining to think we only have the basic 16 named colors available?
