I see 2 potential problems:
1 - You are probably having problem because they are two different objects (with the same value). Take a look at this to know more about objects comparison in JavaScript.
The quickest/easiest fix would be to just compare their values instead of the color.
2 - You should make sure the green color you are getting from the texture is "pure", that is, it's (0.098f,0.451f,0f,1f)
and not (0.09800001f,0.451f,0f,1f)
.
It's dangerous to compare floats, for example 1.0f == 10f/10f might not return true. You can use Unity's Mathf.Approximately() to make these comparisons.