Color Conversion in JavaScript