         bPath.fill()
     }
     
+    func chooseNextColor()
+    {
+        var colorType = ColorFade.RANDOM
+        switch colorType
+        {
+        case .RANDOM:
+            colorFade += colorInc
+            if colorFade >= 100
+            {
+                colorFade -= 100
+                thisColor = nextColor
+                nextColor = colorRGB([randflt(), randflt(), randflt()])
+            }
+            rgbColor = thisColor.fadeTo(nextColor, fade:colorFade/100.0)
+        }
+    }
+        
     func cubeSize() -> (w: Int, h: Int) 
     {
         var h = height()/size.y

    func width() -> Int { return Int(bounds.size.width) }
    func height() -> Int { return Int(bounds.size.height) }
    func randint(n: Int) -> Int { return Int(arc4random_uniform(UInt32(n)+1)) }
    func randflt() -> Float { return Float(arc4random()) / Float(UINT32_MAX) }    
}

extension NSColor {


        center.x = size.x/2
        center.y = size.y/2
        
        colorInc = Float(20+randint(20))/Float(size.y)

        pos = center // start at centre
                        
