3

I'm using a jquery plugin that seems to need the color in "000000" format but when I do this:

currentcolor = $("#" + dividediting).css("background-color");

I get the output as:

rgb(0,0,0)

I'm wondering if there is a way to change the way it outputs or if I have to use regex to parse the result to get it to the needed format.. thanks for any advice

Rick
  • 16,612
  • 34
  • 110
  • 163
  • I think you may have to parse it. Example: http://stackoverflow.com/questions/1740700/jquery-get-hex-value-rather-rgb – DA. Jul 21 '10 at 21:05

1 Answers1

3

This is the browser returning the parsed and processed colour value, it's got nothing to do with jQuery as such.

If you need to convert the value, see this question

rgb(x,z,y) is valid CSS as well, though.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088