title: Cannot invoke initializer for type 'Range<String.Index>' with an argument list of type '(start: String.Index, end: String.Index)'
body: <pre><code>let greenHex = hex.substring(with: Range&lt;String.Index&gt;(start: hex.index(hex.startIndex, offsetBy: 2), end: hex.index(hex.startIndex, offsetBy: 4)))
  </code></pre>
  
  <p>This is Swift3.0, hex is a string, but this code throws an error saying that: </p>
  
  <blockquote>
    <p>Cannot invoke initializer for type 'Range' with an
    argument list of  type '(start: String.Index, end: String.Index)'</p>
  </blockquote>