mirror of
https://github.com/hyperoslo/Cache.git
synced 2026-04-07 19:17:36 +00:00
14 lines
330 B
Swift
14 lines
330 B
Swift
#if os(macOS)
|
|
import Cocoa
|
|
|
|
extension TestHelper {
|
|
static func image(color: NSColor = .red, size: NSSize = .init(width: 1, height: 1)) -> NSImage {
|
|
let image = NSImage(size: size)
|
|
image.lockFocus()
|
|
color.drawSwatch(in: NSMakeRect(0, 0, size.width, size.height))
|
|
image.unlockFocus()
|
|
return image
|
|
}
|
|
}
|
|
#endif
|