An NSButton subclass that looks just like the Yosemite+ native window close button, including the hover and press states. Made entirely programatically.
Installation can be done via cocoapods.
pod 'MKBOSXCloseButton'
To use, drag a new button onto your view in IB ('Square' style seems to work best). Make it a subclass of MKBCloseButton. Untick 'Bordered' and tick 'Transparent' in the inspector.