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