Colour converter
HEX, RGB and HSL with alpha.
Method
HEX is rounded to 8 bits per channel including alpha. RGB/HSL use up to 4 decimal places, so a round trip may differ by one channel level. Supports3/4/6/8-digit HEX, numeric/percentage RGB, degree/percentage HSL and optional alpha. Named colours, other spaces, calc() and CSS variables are rejected.