Given two rgb colors and a rectangle, I\'m able to create a basic linear gradient. This blog post gives very good explanation on how to create it. But I want to add one more
The comment of @user2799037 is totally correct: each line is moved by some pixels to the right compared to the previous one.
The actual constant can be computed as the tangent of the angle you specified.