         }
         
 //        if (skip != 0):
-        NSColor(red: c.redComponent, green: c.greenComponent, blue: c.blueComponent, alpha: 1.0).set() // top
+        color.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:
        let d1 = CGFloat(0.6)
        NSColor(red: c.redComponent*d1, green: c.greenComponent*d1, blue: c.blueComponent*d1, alpha: 1.0).set() // left
        path = NSBezierPath()
        path.moveToPoint(NSPoint(x: x    ,y: y))
        path.lineToPoint(NSPoint(x: x-w  ,y: y+s))

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


