from
Turn the given hex string into a color.
If it is 8 characters long, it is assumed to be in the format
#RRGGBBAA(alpha optional)If there is a leading
#, it will be removed.If it is 1 character long, the character is repeated e.g.
#f->#ffffffIf it is 2 characters long, the character is repeated e.g.
#0f->#0f0f0fIf it is 3 characters long, the character is repeated e.g.
#0fe->#00ffee
Throws
if the hex string is not in a valid format
if the hex string is not a valid hex string