Jquery comparing background color
===

I am using

       var element = $(this).parents("tr:first");
  
       if(element.css("background-color")=="black")
           element.animate({ backgroundColor: "white" }, 1000);
       else
           element.animate({ backgroundColor: "black" }, 1000);


To change background color, but comparision seems to fail, I also tried

    if(element.css("background-color")==rgb(0,0,0))

But the if condition seems to return false everytime?

