1 person found this helpful
Color objects are actually an array, and arrays can't be compared to each other directly in JS.
So this code will return false:
 == 
The solution is to use the built-in equal method of the color object.
For example, this will return true:
color.equal(color.red, ["RGB", 1, 0, 0])
You can use this:
f1.fillColor.join('|') == color.gray.join('|')
2 people found this helpful
Why would you want to do that if you have a perfectly good built-in comparison method, that even converts the two values to the same color-space, if needed?
For example, this returns true:
This returns false:
["RGB",1,1,0].join('|') == ["CMYK",0,0,1,0].join('|')
I have only found the join solution.
Thank you, good to know!