2 // HistoryMarkTransformer.swift
5 // Created by Hori,Masaki on 2017/01/05.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 class HistoryMarkTransformer: ValueTransformer {
12 override class func transformedValueClass() -> Swift.AnyClass {
15 override func transformedValue(_ value: Any?) -> Any? {
16 guard let v = value as? Bool else { return nil }
17 return v ? HistoryMarkTransformer.markImage : nil
20 static var markImage: NSImage = {
21 let radius: CGFloat = 10.0
22 let image = NSImage(size: NSSize(width: radius, height: radius))
24 NSColor.red.highlight(withLevel: 0.6)?.set()
25 NSBezierPath(roundedRect: NSRect(x: 0, y: 0, width: radius, height: radius),