parseColor converts a colour value specified in CSS to a hex based colour code. Example supported input values/formats/named colours are: #0080FF, rgb(0, 128, 255), rgba(0, 128, 255, 0.5) and red, green, etc.

parseColor(color)

Arguments

color

The colour to convert.

Value

The colour as a hex code, e.g. #FF00A0.