colour.conversions.hex2web

colour.conversions.hex2web(hex_color: str) str

Convert HEX representation to WEB.

Parameters

rgb – 3 hex char or 6 hex char string representation

Return type

web string representation (human readable if possible)

WEB representation uses X11 rgb.txt to define conversion between RGB and english color names.

>>> from colour import hex2web
>>> hex2web('#ff0000')
'red'
>>> hex2web('#aaaaaa')
'#aaa'
>>> hex2web('#abc')
'#abc'
>>> hex2web('#acacac')
'#acacac'