Set as HEX, outputs as RGB

I just spent a long while trying to work out why my colour picker wasn’t working and just realised although I set the background colours as HEX using inline styling they output as RGB when requested with javascript. I have a RGB to HEX converter, but is there a way of getting it to alert what it was actually set it too?

Post the code.

I have a RGB to HEX converter, but is there a way of getting it to alert what it was actually set it too?

If you’ve got a function then you just need to alert the result don’t you?

alert(rgbToHex(255,255,255)); // #ffffff

Yeah, I got it using

set_hex_colours(rgb2hex(this.backgroundColor.replace(/(rgb\\(|\\ |\\))/gi,"")));

But weird that I set it as one, the one I’m working with, and the browser sets it as another.

You’re right, it is one of those weird inconsistencies in the DOM between browsers.