Ask Your Question

How to know the name of the standard Color present in Color.colorlist

asked 2013-08-08 14:15:35 -0500

Shuvam_Bosana gravatar image

I have a color and I want to know its name. As the color can be anything and thus might not have any real name, I am detecting the closest standard color (among the ones present in SimpleCV.Color.colorlist) with this code:

for c in s.Color.colorlist:
    for rgb in range(3):
    if diff<least:


Now the thing is how can I know the name of this color variable?

I am guessing this is not really possible with SimpleCV because of the way the color module is arranged, but in that case shouldnt it be more helpful so that this things are possible by default?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-08-09 15:58:44 -0500

Shuvam_Bosana gravatar image

o thnks.. this would be a great help..

edit flag offensive delete link more

answered 2013-08-09 07:18:23 -0500

Davis Marques gravatar image

updated 2013-08-09 07:20:49 -0500

If I'm understanding your question correctly: You might consider using the webcolors package (available in PiPi at It provides a variety of functions for converting colors from one representation to another. Of interest to you would be the rgbtoname() function.

The one drawback with this function is that it requires an exact match. If you don't have an exact match, it throws a ValueError.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-08-08 14:15:35 -0500

Seen: 369 times

Last updated: Aug 09 '13