 private extension String {
   
   func repeat (count: Int) -> String {
-    return "".stringByPaddingToLength(countElements(self) * count, withString: self, startingAtIndex:0)
+    return "".stringByPaddingToLength((self as NSString).length * count, withString: self, startingAtIndex:0)
   }
   
   subscript (i: Int) -> String {

      hex = hex.substringFromIndex(hex.startIndex.successor())
    }
    
    switch countElements(hex) {
      case 1: // Turn "f" into "ffffff"
        hex = hex.repeat(6)
      case 2: // Turn "ff" into "ffffff"

        break
    }
    
    assert(count(hex) == 6, "Invalid hex value")
    
    var r: UInt32 = 0
    var g: UInt32 = 0
