Jquery, getting .css "background-color" in #000000 format?
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
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.
精彩评论