I am trying to find out if a hex color is "blue". This might be a very subjective thing when comparing different (lighter/ darker) shades of blue or close to blue colors but in my case it does not have to be very precise. I just want to determine if a color is blue or not.
The more generalized question would be, is there a way to calculate which of the "basic colors" is closest to a given hex value? Basic colors being red, blue ,green, yellow, purple, etc. without being too specific.
I am looking for an implementation or library in python but a general solution would also suffice.