Trouble with color name

I was using a color extractor extension to pick out the color in any picture the user insert to the app
The extension worked just well but the colors come out in hex
How can I make the colors that the extension will put out from the picture in it’s real name like red or orange or blue,etc

This will be very difficulrt, there are millions of colors. Try playing with Name that Color.

Sample code

<script type="text/javascript" src="https://chir.ag/projects/ntc/ntc.js"></script>

<script type="text/javascript">

  var n_match = ntc.name("#6195ED");
  n_rgb = n_match[0]; // RGB value of closest match
  n_name = n_match[1]; // Text string: Color name
  n_exactmatch = n_match[2]; // True if exact color match

  alert(n_match);

</script>

Visit: ntc js (Name that Color JavaScript) - Chirag Mehta : chir.ag

1 Like

Or use an api, here I found an open-source api on github.

https://www.thecolorapi.com/

By using https://www.thecolorapi.com/id?hex=YOUR_HEX, a json will be returned. In “name” → “value” there is the closest colour name.

1 Like

I am sorry I am still a beginner and I am doing this for my school project can you further explain how can i do this with blocks , thankyou

Do you have the extension of “name that color”??

See an example, when button is pressed you get all colors in image in hex format. By pressing each color you get the name in a label

extract_color.aia (494.0 KB)

1 Like

Thankyou very much I understand what you mean but I meant how to use the extension to build this