splash/Sources/SplashImageGen/Extensions/NSGraphicsContext+Fill.swift

19 lines
293 B
Swift
Raw Normal View History

2018-08-24 18:42:07 +02:00
/**
* Splash
* Copyright (c) John Sundell 2018
* MIT license - see LICENSE.md
*/
#if os(macOS)
import Cocoa
extension NSGraphicsContext {
func fill(with color: NSColor, in rect: CGRect) {
cgContext.setFillColor(color.cgColor)
cgContext.fill(rect)
}
}
#endif