title: How to get the pixel color on touch (Swift)?
body: <p>I have various <code>CAShapeLayers</code> that each have a distinctive colour, made like this:</p>
  
  <pre><code>    shape1.strokeColor = UIColor(red: 85/255.0, green: 176/255.0, blue: 112/255.0, alpha: 1.0).
      shape2.strokeColor = UIColor(red: 222/255.0, green: 171/255.0, blue: 66/255.0, alpha: 1.0).CGColor
  </code></pre>
  
  <p>Using a <code>touchesBegan</code> function, I want to determine whether a <code>CAShapeLayer</code> has been tapped, and which particular one it was, in order for a suitable action to occur. I know it is possible to use <code>hitTest</code> and <code>CGPathContainsPoint</code>, but I want use a different method. How do I compare the colour of the point tapped with the colour of the <code>CAShapeLayers</code>?</p>
  
  <p>Any help would be appreciated</p>