Syntax
- string colorHexToR(hex)
Parameters
- hex—stringHex color string in the format "#rrggbb" or "#rrggbboo"
Returns
Returns R value in [0,1] after converting hex color to RGB.
Description
The colorHexToR function converts a hex color string to RGB and returns the R value.
Related
Examples
example.1
colorHexToR("#4080BF")
# result = 0.2509803921568628
example.2
colorHexToR("#4080BF80")
# result = 0.2509803921568628