Don't try to hard to encounter a perfectly accurate answer for this. After all, there is no such thing as a perfect defined line between red-ish and not red-ish.
The way I would approach this is: first, check that color is not too grey/black. This can be done using the sum of the three components (keep in mind that full black is 0;0;0 on RGB, greys are usually something like 55;55;55). For example, you could consider as too dark any color whose components sum up less than 300. Play a little bit with any RGB picker tool to find the threshold you like the most.
EDIT: from comment below I see sum of three components won't work, for example the 255;0;0 would be consider as too grey. So you have to use maximum value of the three components. For example, 20;0;0 would still be quite dark, but 100;0;0 not so much. Thanks to @rafalon for pointing this out.
Then, you would need to check that this color is close to a "pure" color, that is, red, green or blue. In order to do that, you would need to compare the most prominent component with the other two. You have to compare this highest component with the other two, individually. This is because a color like 255;0;255 is not redish at all, while a 255;128;128 could be considered as such. So combination of the two less prominents components won't do the trick.
You could consider a color to be red-ish if both Green and Blue have a value lower than some percentage of red. Take for example this percentage to be 50%. Then, you need to check that green is less than 0.5 * red AND blue is less than 0.5 * red. Again, you should play a bit with RGB colors to find a percentage that you think it suits.
TL;DR: for a color with components r, g and b, this color will be a "pure" color if:
Max(r, g, b) > tooDarkValue
r > somePercentage * Max(r, g, b) AND g > somePercentage * Max(r, g, b) AND b > somePercentage * Max(r, g, b)
Note that second condition will always be true for Max(r, g, b), (any number is greater than a percentage of itself), so no need to evaluate which component is highest and then have 3 different conditions
HSV
color model and check forH
(Hue
) and may be forS
(Saturation
): if we have a rightHue
(say,Green
) and not very lowSaturation
(not too colorless lake gray, white, black) we can say we have a greenish color – Seta