RGB to HEX converter for JavaScript