title: How to create a color patterns in Android Canvas
body: <p>I am working on Android Canvas. I am trying to set this kind of zigzag color in my rectangle how can I achieve this. </p>
  
  <p><img src="https://i.stack.imgur.com/mVExb.png" alt="enter image description here"></p>
  
  <pre><code>Paint myPaint = new Paint();
  myPaint.setColor(Color.RED);
  myPaint.setStrokeWidth(10);
  c.drawRect(100, 100, 200, 200, myPaint);
  </code></pre>