Colormap
This colormapping library was originally written for use in Hextractor, a tool for web designers and developers to generate an HTML color palette from CSS. After Hextractor was finished I thought it may be useful to others as well so I've released the code for use in your own applications. It’s available in your choice of PHP or Ruby.
The ColorMap class contains a mapping of the full list of 147 HTML named colors to their hexadecimal equivalents, as well as methods to convert colors in hexadecimal, RGB, or these named colors, into any other of these three formats.
Download
Download Colormap from Github: PHP or Ruby
If you prefer Python, James Bennett has created a Python version called Webcolors which is available from the Python package repository.
License
Colormap is released under the terms of the MIT License and is free to use and redistribute for any purpose. If you find this code helpful, a link back to my site would be cool, but it’s not required.