How to convert colors in RGB format to hex format and vice versa?
For example, convert \'#0080C0\' to (0, 128, 192).
\'#0080C0\'
(0, 128, 192)
function hex2rgb(hex) { return ['0x' + hex[1] + hex[2] | 0, '0x' + hex[3] + hex[4] | 0, '0x' + hex[5] + hex[6] | 0]; }