2 // HMUpgradeShipExcludeColorTransformer.m
5 // Created by Hori,Masaki on 2015/12/12.
6 // Copyright © 2015年 Hori,Masaki. All rights reserved.
9 #import "HMUpgradeShipExcludeColorTransformer.h"
11 #import "HMUpgradableShipsWindowController.h"
14 @implementation HMUpgradeShipExcludeColorTransformer
17 static dispatch_once_t onceToken;
18 dispatch_once(&onceToken, ^{
19 [NSValueTransformer setValueTransformer:[self new] forName:@"HMUpgradeShipExcludeColorTransformer"];
22 + (Class)transformedValueClass
24 return [NSColor class];
26 + (BOOL)allowsReverseTransformation
31 - (id)transformedValue:(id)value
33 if(isExcludeShipID(value)) {
34 return [NSColor lightGrayColor];
36 return [NSColor controlTextColor];