colorHexToO

Synopsis

string colorHexToO(string hex)

Parameters

Returns

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

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

Related

Examples

example.1
	colorHexToO("#4080BF80")
	# result = 0.5019607843137256

example.2
	colorHexToO("#4080BF")
	# result = 0

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