0

I am not really sure how to phrase this, but let me explain what I am trying to do. I want to say "this color is green" or "this color is a mix of green and blue", or "this is a light green" or "this is a dark green", or perhaps even "this is a pastel green" or "this is a neon green" if we want to get more specific and add more dimensions.

The way to do this I imagine is to have a range of colors. If these were numbers, I would say "if number is > 100 and < 1000, it is a blue, if it is > 100 and < 300 it is a light blue, if it is > 700 and < 1000 it is a dark blue, if it is > 1000 and < 2000 it is a green, etc.". I am not really sure how this would work or if it is possible with hex/rgb/hsl values.

It seems that one way to do it would be to have data for each "patch" of color type. So for "reds" (light red, regular red, dark red, pastel red, brick red, neon red, etc.) there would be a patch of color. Then if the hex/rgb/hsl value falls ~within~ that patch (whatever that means), it is called "brick red" or whatnot.

The question is (a) if this data has already been collected somewhere and is available to use, or (b) if not, how to accomplish this. How do I select basically a box/circle from the color grid in a color picker, or multiple boxes/circles, (assign those a name like "brick red"), and then how to test if a given color (hex/rgb/hsl) falls into one of those boxes/circles. My mind is a little bent around this.

Lance
  • 75,200
  • 93
  • 289
  • 503
  • Looks like a duplicate of https://stackoverflow.com/questions/37951568/get-a-color-name-from-any-rgb-combination-script-included – nice_dev Jun 02 '19 at 14:38
  • (a) is off-topic, (b) is quite broad, not sure if *too broad* ... – Jonas Wilms Jun 02 '19 at 14:38
  • 2
    Seems like HSL or HSV representation would be a good start. – Pointy Jun 02 '19 at 14:38
  • @Pointy do I have to manually go through and tag the colors myself, or has this been done somewhere before. – Lance Jun 02 '19 at 14:39
  • https://en.wikipedia.org/wiki/HSL_and_HSV – Andreas Jun 02 '19 at 14:39
  • Well it's intrinsically subjective, and it depends on what you're using these characterizations for. – Pointy Jun 02 '19 at 14:42
  • As pointed out by @Pointy, HSV representation is a good way to find what you want, specifically the Hue part. – Anis R. Jun 02 '19 at 14:43
  • I want to have a picture of a lizard or some animal, and say that it is "brown" and "green". – Lance Jun 02 '19 at 14:44
  • 1
    regarding brown and green, I would first try to find most [representated colors](https://stackoverflow.com/questions/43111029/how-to-find-the-average-colour-of-an-image-in-python-with-opencv). Then for some given threesold of your choice, select your kept colors, and label them by calculating the distance to their label class (euclidian distance in the cielab color space) – grodzi Jun 02 '19 at 16:36
  • Possible duplicate of [Get the closest color name depending on an hex-color](https://stackoverflow.com/questions/17175664/get-the-closest-color-name-depending-on-an-hex-color) – Peter O. Jun 02 '19 at 19:27

0 Answers0