If you're considering your needs and utilization of CSS3 (or lack thereof), you might want to achieve this using Javascript/jQuery. jQuery, in particular, could be beneficial, and exploring jQueryUI could be a good idea.
For more information, you can refer to this query on StackOverflow.
For quick results, here's a versatile Fiddle adapted from the aforementioned question which might meet your requirements or at least act as a starting point. However, I recommend further research and exploring the provided links.
The Fiddle's code:
JQuery:
function changeColor(element, curNumber){
curNumber++;
if(curNumber > 2){
curNumber = 1;
}
console.log(curNumber);
element.addClass('color' + curNumber, 500);
element.attr('class', 'color' + curNumber);
setTimeout(function(){changeColor(element, curNumber)}, 1000);
}
changeColor($('#testElement'), 0);
CSS:
.color1{
background: white;
color: black;
}
.color2{
background: black;
color: white;
}
HTML:
<div id="testElement">This will change colors</div>