         path.fill()
     }
 
+}
+
+extension NSColor {
     
-    func darkenColor(color: NSColor, factor: Float) -> NSColor {
+    func darken(factor: Float) -> NSColor {
         let f = CGFloat(factor)
-        let red = color.redComponent
-        let green = color.greenComponent
-        let blue = color.blueComponent
+        let red = redComponent
+        let green = greenComponent
+        let blue = blueComponent
         return NSColor(red: red*f, green: green*f, blue: blue*f, alpha: 1)
     }
-    
+
 }
 
 

        path.fill()
        
//        if skip != 1:
        darkenColor(color, factor: 0.6).set()
        path = NSBezierPath()
        path.moveToPoint(NSPoint(x: x    ,y: y))
        path.lineToPoint(NSPoint(x: x-w  ,y: y+s))

        path.fill()
        
//        if skip != 2:
        color.darken(0.25).set()
        path = NSBezierPath()
        path.moveToPoint(NSPoint(x: x    ,y: y))
        path.lineToPoint(NSPoint(x: x+w  ,y: y+s))
