title: Algorithm for a diagonal non-linear gradient
body: <p>I'm looking for an algorithm to generate the following image:</p>
  
  <p><img src="https://i.stack.imgur.com/ohG3j.png" alt="Desired output"></p>
  
  <p>I'm only interested in the data shown in the upper left half (diagonal) of the square.</p>
  
  <hr>
  
  <p>I'm currently at a starting point where I have the following simple linear function:</p>
  
  <pre><code>double GetColorAt(double x, double y)
  {
     return 1 - (x + y);
  }
  </code></pre>
  
  <p>where x runs from left to right and y from top to bottom in the ranges of [0...1]. The return value is a color component for RGB channels in the range of [0...1]. It generates me this:</p>
  
  <p><img src="https://i.stack.imgur.com/sQXoS.png" alt="Current output"></p>