Hi!
Color in AE is an array [red, green, blue, alpha]. And you can’t compare two arrays using “==”. More info here. Instead of this you need to check every value in array separately. Also you don’t need to check alpha value (the last value (id = 3) in array). So this code should work for you:
cColor = effect("check Color")("Color"); //the color it should check
gColor = effect("Global Color")("Color"); //the color it should be if its the checked color
vColor = effect("Wales")("Color"); //the value color
if ((vColor[0] == cColor[0]) &&
(vColor[1] == cColor[1]) &&
(vColor[2] == cColor[2])){
gColor
}else{
vColor
}