I don't know if this is an issue for you, but if you don't necessarily know what the previous color is, you have to store the old color someplace when you do the switch.
(This might be the case, say, if you have a bunch of items of various colors, and you want to make each one yellow when it's highlighted, but then go back to it's old color once something else gets highlighted.)
Fortunately jQuery lets you store arbitrary data about a given element. Something like:
//in the function that sets the new color
$(this).data("oldColor", $(this).css("color")); //store the old color with the element
$(this).css("color", "yellow");
//in the function that reverts to the old color
if ($(this).data("oldColor")) {
$(this).css("color", $(this).data("oldColor"));
$(this).data("oldColor", null);
}