I\'ve written a jQuery plugin that accepts css colors for some of its parameters.
I want to validate them. If it was just a hex or rgb value I could do that with a r
function test(myColor) { var valid = $('#test').css('color'); $('#test').css('color', myColor); if (valid == $('#test').css('color')) alert("INVALID COLOR"); else { alert("VALID"); $('#test').css('color', valid); } } test("TATATA"); test("white");
asdasdasdasd
It is hastily written but it works.