dimanche 22 février 2015

Algorithm for a diagonal non-linear gradient

I'm looking for an algorithm to generate the following image:


Desired output


I'm only interested in the data shown in the upper left half (diagonal) of the square.




I'm currently at a starting point where I have the following simple linear function:



double GetColorAt(double x, double y)
{
return 1 - (x + y);
}


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:


Current output


Aucun commentaire:

Enregistrer un commentaire