1 | initial version |
IF you want to check the percentage of the color red(R=255 , G = 0 , B = 0) the count pixels and calculate the ratio.. but if you'are looking for a certain range you'll have to decide that by yourself. RGB and CMY are both in the range 0~255
this is the conversion formula :
float C = 1 - (R / 255);
float M = 1 - (G / 255);
float Y = 1 - (B / 255);