This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{'Pink': 'Pink'}, | |
{'LightPink': 'Pink'}, | |
{'HotPink': 'Pink'}, | |
{'DeepPink': 'Pink'}, | |
{'PaleVioletRed': 'Pink'}, | |
{'MediumVioletRed': 'Pink'}, | |
{'Lavender': 'Purple'}, | |
{'Thistle': 'Purple'}, | |
{'Plum': 'Purple'}, | |
{'Orchid': 'Purple'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Original Author Ernesto P. Adorio, Ph.D | |
Original Source: http://my-other-life-as-programmer.blogspot.com/2012/02/python-finding-nearest-matching-color.html | |
Modifed By: JDiscar | |
This class maps an RGB value to the nearest color name it can find. Code is modified to include | |
ImageMagick names and WebColor names. | |
1. Modify the minimization criterion to use least sum of squares of the differences. | |
2. Provide error checking for input R, G, B values to be within the interval [0, 255]. |