Type the following in the Javascript console:
color.toSource();
This will print the color data structure and with that, you have a full list of all named colors. To save you the trouble of doing this, here is the list:
({
transparent: ["T"],
black: ["G", 0],
white: ["G", 1],
dkGray: ["G", 0.25],
gray: ["G", 0.5],
ltGray: ["G", 0.75],
red: ["RGB", 1, 0, 0],
green: ["RGB", 0, 1, 0],
blue: ["RGB", 0, 0, 1],
cyan: ["CMYK", 1, 0, 0, 0],
magenta: ["CMYK", 0, 1, 0, 0],
yellow: ["CMYK", 0, 0, 1, 0],
convert: function ColorConvert(oColor, cColorspace) {
var oOut = oColor;
switch (cColorspace) {
case "G":
if (oColor[0] == "RGB") {
oOut = new Array("G", 0.3 * oColor[1] + 0.59 * oColor[2] + 0.11 * oColor[3]);
} else if (oColor[0] == "CMYK") {
oOut = new Array("G", 1 - Math.min(1, 0.3 * oColor[1] + 0.59 * oColor[2] + 0.11 * oColor[3] + oColor[4]));
}
break;
case "RGB":
if (oColor[0] == "G") {
oOut = new Array("RGB", oColor[1], oColor[1], oColor[1]);
} else if (oColor[0] == "CMYK") {
oOut = new Array("RGB", 1 - Math.min(1, oColor[1] + oColor[4]), 1 - Math.min(1, oColor[2] + oColor[4]), 1 - Math.min(1, oColor[3] + oColor[4]));
}
break;
case "CMYK":
if (oColor[0] == "G") {
oOut = new Array("CMYK", 0, 0, 0, 1 - oColor[1]);
} else if (oColor[0] == "RGB") {
oOut = new Array("CMYK", 1 - oColor[1], 1 - oColor[2], 1 - oColor[3], 0);
}
break;
default:
;
}
return oOut;
},
equal: function ColorEqual(c1, c2) {
if (c1[0] == "G") {
c1 = color.convert(c1, c2[0]);
} else {
c2 = color.convert(c2, c1[0]);
} if (c1[0] != c2[0]) {
return false;
}
var nComponents = 0;
switch (c1[0]) {
case "G":
nComponents = 1;
break;
case "RGB":
nComponents = 3;
break;
case "CMYK":
nComponents = 4;
break;
default:
;
}
for (var i = 1; i <= nComponents; i++) {
if (c1[i] != c2[i]) {
return false;
}
}
return true;
}
})
Keep in mind that you can create any color you want based on the RGB or CMYK values.
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com