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

        }
        
//        if (skip != 0):
        NSColor(red: c.redComponent, green: c.greenComponent, blue: c.blueComponent, alpha: 1.0).set() // top
        var path = NSBezierPath()
        path.moveToPoint(NSPoint(x: x   ,y: y))
        path.lineToPoint(NSPoint(x: x+w ,y: y+s))

        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))
