I\'m getting image pixel data like this:
var p = c.getImageData(x, y, 1, 1).data;
var red = p[0];
var green = p[1];
var blue p[2];
Sorry for th
Any colour in the hue range from 180 to 300 can be considered blue, since that's the primary colour that is dominant. However, if you want to consider secondary colours too, then your range is 210 to 270. Then you have to factor in things like "it still looks cyan" (since green is far more perceptually bright than blue) and stuff like that, there's really no hard-and-fast definition.
So what you could do is say "if( max( red, green, blue) == blue) then it's blue" and nobody can fault you for it.