We can natively animate HTML elements in pure CSS. which means we can add from and to colour to animate colour.
@keyframes example {
from {background-color: green;}
to {background-color: yellow;}
}
div {
width: 100px;
height: 100px;
background-color: green;
animation-name: example;
animation-duration: 4s;
}