I have a question about tkColorChooser. I am working on a GUI for plotting functions and a user of the program has to pick the color of the function they want to plot. I would like to test whether the color they pick is a valid tkColorChooser color.
I was thinking about doing tests such as len(colorString) == 7 (or 4) or colorString.startswith('#'), but I would still have to do testing for the color names such as 'black' and 'green' and all other colors available... It all seems like a lot of work, so I was wondering if there is an easier way to do that?
I am interested in a test such as
string = 'black'
Is string a valid color ?
return True
string = 'blac'
Is string a valid color?
return False
Cheers!