Overview of webcolors functionality
trunkwebcolors is a Python module designed for working with and converting between various HTML/CSS color formats. It supports normalization and conversion within the RGB colorspace for the following formats:
- Specification-defined color names
- Six-digit hexadecimal
- Three-digit hexadecimal
- Integer
rgb()triplets - Percentage
rgb()triplets
Note: For conversions involving HSL, you should use the colorsys module from the Python standard library, as webcolors focuses on the RGB colorspace.
import webcolors
webcolors.hex_to_name("#daa520")
# 'goldenrod'