title: Smooth color transition algorithm
body: <p>I am looking for a general algorithm to smoothly transition between two colors.</p>
  
  <p>For example, this image is taken from <a href="http://en.wikipedia.org/wiki/File:Black-body-in-mireds-reversed.png" rel="noreferrer">Wikipedia</a> and shows a transition from orange to blue.</p>
  
  <p><img src="https://i.stack.imgur.com/u1SMg.png" alt="enter image description here"></p>
  
  <p>When I try to do the same using my code (C++), first idea that came to mind is using the HSV color space, but the annoying in-between colors show-up.</p>
  
  <p><img src="https://i.stack.imgur.com/0wmXK.png" alt="enter image description here"></p>
  
  <p>What is the good way to achieve this ? Seems to be related to diminution of contrast or maybe use a different color space ?</p>