colorHexToO

Syntax

float colorHexToO(hexValue)

Parameters

Returns

Returns O value in [0,1] from hexadecimal color string in the format "#rrggbboo" where "oo" are the opacity values

Description

This function extracts the opacity value from a hexadecimal color string and converts it to a value in [0,1]. Returns 0 if hexadecimal string is too short.

Related

Examples

colorHexToO("#4080BF80")
# result = 0.5019607843137256

colorHexToO("#4080BF")
# result = 0

Copyright ©2008-2023 Esri R&D Center Zurich. All rights reserved.