Defines objects for hexadecimal triplet notation:
Converts from RGB colourspace to hexadecimal triplet representation.
Parameters: | RGB (array_like, (3,)) – RGB colourspace matrix. |
---|---|
Returns: | Hexadecimal triplet representation. |
Return type: | unicode |
Notes
Examples
>>> RGB = np.array([0.66666667, 0.86666667, 1])
>>> # Doctests skip for Python 2.x compatibility.
>>> RGB_to_HEX(RGB)
'#aaddff'
Converts from hexadecimal triplet representation to RGB colourspace.
Parameters: | HEX (unicode) – Hexadecimal triplet representation. |
---|---|
Returns: | RGB colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
Examples
>>> HEX = '#aaddff'
>>> HEX_to_RGB(HEX)
array([ 0.6666666..., 0.8666666..., 1. ])