Im looking for a function to draw a gradient line. It can be accomplished by drawing a gradient rectangle 1px wide, but somehow I always get the wrong colors. I think because the positions inside the rect are relative, and I need to draw the line using absolute positions.
So can someone show a quick example function?