text: Q:
  
  Fade between two colors with JavaScript / jQuery
  
  Is it possible to fade between colors? 
  I'm working on a small project and based on the time elapsed since opening the site, the background is supposed to change colors. It's working fine but it's based on seconds elapsed and cutting hard to the next color in line. 
  so, eg.:
    if(totalSeconds > 10){
       $('.lead').css('color', '#95EB00');
       $('body').css('background-color', '#95EB00');
    }
  
    if(totalSeconds > 15){
       $('.lead').css('color', '#09E845');
       $('body').css('background-color', '#09E845');
    }
  
  is it possible to change colors in a time interval from x-seconds? and fade to the next color?
  
  A:
  
  The other response answers your title directly, but using a css animation would be a better fit to the problem trying to be solved.
  
  body {
      background-color: red;
      animation: bg-transition 5s linear 0s forwards;
  }
  
  
  @keyframes bg-transition {
    0%, 50% {
      background-color: red; 
    }
  
    100% {
      background-color: blue;
    }
  }
  
  