How to draw a line with a certain gradient?