title: Core Graphics: Drawing along a path with a normal gradient
body: <p>There are a number of resources here and elsewhere on the web regarding how to draw with a gradient - fill or stroke.</p>
  
  <p>However, AFAICT, none addresses the following requirement: how to draw a path with a <em>normal</em> gradient, whereby <em>normal</em> means orthogonal to the path. The net effect could be something like toothpaste or a tube when applied with a dark->light->dark linear gradient. Here is this idea in the case of a round rectangle:</p>
  
  <p><a href="http://muys.net/cadre_blanc.png" rel="nofollow noreferrer">round-rect tube http://muys.net/cadre_blanc.png</a></p>
  
  <p>(this was hand drawn and the corners are not very good).</p>
  
  <p>In the specific case of the round rect, I think I can achieve this effect with 4 linear gradients (the sides) and 4 radial gradients (the corners). But is there better?</p>
  
  <p>Is there an easy solution for any path?</p>