The Color Object
Run the word color in the JavaScript console and it will return [object object]. Since Acrobat has a built-in object called color, you should never use the word color as a variable because that term is already taken and your variable will override the built-in color object, rendering it useless for the remainder of the session.
Run the following script in the console:
for(i in color)
{console.println(i)}
It will return the following list:
equal
convert
transparent
black
white
dkGray
gray
ltGray
red
green
blue
cyan
magenta
yellow
The first two in the list are functions. The color.equal function compares two color arrays to see if they are equal and returns true or false. Since color arrays can be expressed as RGB, CMYK, G, or T (transparent) the conversion is done if necessary. For example:
color.equal(["RGB",0.5,0.5,0.5],["G",0.5]);//returns true
color.equal(["RGB",0.5,0.5,0.5],["G",0.75])//returns false