Simplified it by drawing the linear easing line on the canvas rather than creating it using a gradient. But I added a comment as well anyway.