title: paperjs: stroke with gradient
body: <p>I want to draw a graph (a line) which is blue when the values are 0 and gets more red when the values are ~100 (so the color of the line has to be a gradient).</p>
  
  <p>I 've got two ideas that might work, but maybe there is a better solution out there.</p>
  
  <ol>
  <li><p>Don't draw a line, but multiple circles every pixel and color those circles based on its x-value.</p></li>
  <li><p>Place the gradient in the background and use the line as a clipping mask. Is that possible in paperjs and if yes how?</p></li>
  </ol>
  
  <p>Although idea 1. is pretty easy to implement I don't think that I will get a smooth result.</p>
  
  <p>I would be very grateful if could give me a better approach or a example how I can use a line as a clipping mask.</p>