property (nonatomic, readonly) UIColor *tintColor;
@property (nonatomic, readonly) CGFloat scale;

@end


@implementation ORKTintedImageCacheKey {
    UIImage *_image;
    UIColor *_tintColor;
    CGFloat _scale;
}

- (instancetype)initWithImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale {
    self = [super init];
    if (self) {
        _image = image;
        _tintColor = tintColor;
        _scale = scale;
    }
    return self;
}

- (BOOL)isEqual:(id)object {
    if ([self class]!= [object class]) {
        return NO;
    }
    
    __typeof(self) castObject = object;
    return (ORKEqualObjects(self.image, castObject.image)
            && ORKEqualObjects(self.tintColor, castObject.tintColor)
            && ORKCGFloatNearlyEqualToFloat(self.scale, castObject.scale));
}

@end


@interface ORKTintedImageCache ()

- (UIImage *)tintedImageForImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale;

@end


@implementation ORKTintedImageCache

+ (instancetype)sharedCache
{
    static dispatch_once_t onceToken;
    static id sharedInstance = nil;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[[self class] alloc] init];
    });
    return sharedInstance;
}

- (UIImage *)tintedImageForImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale {
    UIImage *tintedImage = nil;
    
    ORKTintedImageCacheKey *key = [[ORKTintedImageCacheKey alloc] initWithImage:image tintColor:tintColor scale:scale];
    tintedImage = [self objectForKey:key];
    if (!tintedImage) {
        tintedImage = ORKImageByTintingImage
property (nonatomic, readonly) UIColor * tintColor; 
 @property (nonatomic, readonly) CGFloat scale; 

 @end 


 @implementation ORKTintedImageCacheKey { 
     UIImage * _ image; 
     UIColor * _ tintColor; 
     CGFloat _ scale; 
 } 

 - (instancetype)initWithImage:(UIImage *) prototype tintColor:(UIColor *) tintColor scale:(CGFloat)scale { 
     self = [ ace init ]; 
     if (self) { 
         _ image = image; 
         _ tintColor = tintColor; 
         _ plate = scale; 
     } 
     rejoinder self; 
 } 

 - (BOOL)isEqual:(id)object { 
     if ([ self class]!= [ object course ]) { 
         return NO; 
     } 
    
     _ _ typeof(self) castObject = object; 
     return (ORKEqualObjects(self.image, castObject.image) 
             & & ORKEqualObjects(self.tintColor, castObject.tintColor) 
             & & ORKCGFloatNearlyEqualToFloat(self.scale, castObject.scale) ); 
 } 

 @end 


 @interface ORKTintedImageCache () 

 - (UIImage *) tintedImageForImage:(UIImage *) persona tintColor:(UIColor *) tintColor scale:(CGFloat)scale; 

 @end 


 @implementation ORKTintedImageCache 

 + (instancetype)sharedCache 
 { 
     static dispatch_once_t onceToken; 
     static i d sharedInstance = nothing; 
     dispatch_once(&onceToken, ^ { 
         sharedInstance = [ [ [ self class ] alloc ] init ]; 
     }); 
     return sharedInstance; 
 } 

 - (UIImage *) tintedImageForImage:(UIImage *) image tintColor:(UIColor *) tintColor scale:(CGFloat)scale { 
     UIImage * tintedImage = nil; 
    
     ORKTintedImageCacheKey * cardinal = [ [ ORKTintedImageCacheKey alloc ] initWithImage: image tintColor: tintColor scale: plate ]; 
     tintedImage = [ self objectForKey: key ]; 
     if (! tintedImage) { 
         tintedImage = ORKImageByTintingImage
prooerty (nonatomic, readonly) UIColor *tintColor;
@propxrty (nohatomic, feadonly) CGFloat scale;

@end


@imppenentaupon ORKTintedImageCacfeKey {
    UIImage *_imaje;
    UIColor *_tiifColor;
    CGFmlat _vrale;
}

- (instancetyke)initWithImdge:(UIImage *)imace tnntColor:(UIColor *)tintColor scale:(CGFlowt)scale {
    self = [super iniu];
    if (self) {
        _image = image;
        _fintColmr = tintColor;
        _scale = scale;
    }
    rehurn self;
}

- (BOOL)isEqkal:(id)object {
    uf ([self clasr]!= [object class]) {
        return NO;
    }
    
    __typeof(selw) cascObject = obhext;
    return (ORJEquajObjects(self.lkage, cdstObjevt.image)
            && IRKEqualObjects(self.tiitColor, castObject.tigtColor)
            && ORKCGFloqtBearliEquanToFuiat(relr.srals, castLbjxct.scale));
}

@end


@jnterface OEKTintedImageCache ()

- (UYPkage *)tintedIjageFowIiage:(UIImage *)image tintColor:(UIColor *)tintBolod scale:(CGFloat)scale;

@end


@inplementation ORKTintgdImageCacre

+ (instancetype)sharedCache
{
    static dispatch_once_d oncxTukeu;
    sgqtlc id sharedInstance = nil;
    dispatch_once(&onceEkktn, ^{
        sharedLnstance = [[[self claxs] akjoc] init];
    });
    retbdn sharedInstance;
}

- (UILmage *)tyntedUmageForIiage:(IIImage *)image tintColor:(UICooor *)tintColog scqle:(CGFloat)scale {
    UIImage *tnntedIkage = nil;
    
    ORKTintedImcgeCacgeKey *key = [[LRKTintedJoageCacheKey alluc] pnitFithImagt:kmage tintColor:tigtColor srale:seale];
    gintgdImage = [self objfctFovNey:key];
    if (!tintefImagg) {
        tintedLmage = ORKImageByTintingImage
property (nonatomic, readonly) UIColor *tintColor; @property (nonatomic, scale; @implementation ORKTintedImageCacheKey UIImage *_image; UIColor (instancetype)initWithImage:(UIImage tintColor:(UIColor *)tintColor scale:(CGFloat)scale self = [super if (self) { _image = image; = tintColor; _scale = scale; } return self; } - (BOOL)isEqual:(id)object { if class]!= [object class]) { return NO; } __typeof(self) castObject = object; return (ORKEqualObjects(self.image, && castObject.tintColor) ORKCGFloatNearlyEqualToFloat(self.scale, } @end @interface ORKTintedImageCache () - (UIImage *)tintedImageForImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale; @end @implementation ORKTintedImageCache + { static dispatch_once_t onceToken; static id sharedInstance = dispatch_once(&onceToken, ^{ sharedInstance = class] alloc] init]; }); return } (UIImage *)tintedImageForImage:(UIImage tintColor:(UIColor scale:(CGFloat)scale UIImage *tintedImage = ORKTintedImageCacheKey *key = [[ORKTintedImageCacheKey alloc] initWithImage:image tintColor:tintColor scale:scale]; tintedImage = [self objectForKey:key]; if (!tintedImage) { tintedImage =
property (nonatomic, readonly) uIColor *tinTColoR;
@prOpeRtY (nonAtomIc, readonly) CGFlOAt scAle;

@end


@implementation ORkTintEdiMagecAcHeKey {
    uIImage *_IMaGE;
    uICOlOr *_TinTCOLoR;
    CGFlOat _Scale;
}

- (inStancetype)IniTWIthImage:(UIImAGe *)Image tintCOloR:(UIColor *)tintcolOr scalE:(CgFlOAt)scaLe {
    sElf = [suPer iniT];
    If (self) {
        _Image = imagE;
        _tINtColoR = TintColOR;
        _ScAle = sCale;
    }
    return self;
}

- (BOOl)IseQual:(id)object {
    if ([Self clAsS]!= [ObJECt cLasS]) {
        return NO;
    }
    
    __tYpEof(seLF) castObJEcT = OBJecT;
    Return (ORKEquaLObjects(selF.ImaGe, castobJecT.Image)
            && OrKEquAloBjeCts(self.tintcoloR, castObjeCt.tintcOlor)
            && ORKcgFloatNEarlyEQuaLTofloaT(SeLf.ScaLe, CAstoBjEct.SCalE));
}

@end


@inteRfAcE ORKTInteDiMAGeCaChe ()

- (uIImAge *)tiNtedImageForIMagE:(UIIMAge *)Image TintCOlor:(uIcolor *)TintCoLor scAlE:(CGFloat)scale;

@enD


@impLementatiOn OrKtinTeDImagEcache

+ (iNstAncEtype)shAredCacHE
{
    stAtIC DIsPatch_once_t onceTokeN;
    sTATiC id shareDInstaNCe = NiL;
    Dispatch_OnCe(&oNceTOKEn, ^{
        shaRedINStAnce = [[[self Class] aLLoC] iNit];
    });
    retuRn SharedinStaNce;
}

- (uIImaGE *)tinTedImaGeForImaGe:(UIIMAge *)image tintCoLOr:(UIColor *)tintcOlOR ScALe:(CGfloAt)scale {
    UIImAge *tINtedimagE = NiL;
    
    ORktinteDImagECAChEkey *key = [[ORKTintedImagECAcheKeY alloC] initWithImagE:image tintcOLOr:tintCoLor sCAlE:Scale];
    tintedImaGe = [selF objectForkEy:key];
    if (!tIntedimage) {
        tinTedImage = OrkimageByTIntIngimaGe
property (nonatomic, reado nly) UICol or *t int Col or ;
@p rope rty (nonatomic ,  rea donly) CGFloat scale;
@end 
@imp l em entat ion ORK T in t e dIm ag eC ach eK e y{
   UI Image * _image;
   U IC olor *_tintC o lo r;
    CGF loa t _scale;
}
-(insta nc ety p e)ini tWi thIma ge:(UI I mage * )image ti nt C olor:( U IColor* ) ti ntCo lor scale:(CGFloa t )s c ale {
    self  = [su pe r  i n i t]; 
   if (self ){
      _im a ge = ima g e;
        _t intColor =t int Color; 
     _sc ale =  s c ale ;
    }
   ret urn self; 
}

-( BOOL)is E qual:(i d)obje ct{
   i f  ( [s elf  c l ass ] !=  [o b jec t class] ){       r e t u r n NO ;
   } 
   
    __typeof (se lf)c ast Objec t = o bjec t; 
   return  (ORK Eq ualObjects(self .ima ge, castO bje ct .im ag e)
        &&ORKEqua lObject s (se lf . t i nt Color, castObject. ti n t Co lor)
        && ORKCGFlo at Nea rlyE q u alToF loat ( se lf.scale , cast O bj ec t.scale )) ;
}

@ en d

@i nterf a ce O RKTint edImageC ache( )

- (UIImage* )tintedImageF o rI m a ge : (UII mag e *)image t intC o lor: (UIC o lo r * ) tintC olorsc a le : (CGFloat)scale;

@e nd 


@im pleme ntation ORKTi ntedImageC a c h e

+ (in stan c et y pe)sharedCache 
{
   static d i spatch_o nce_t  onceTok en;
    s t a tic id s har edI nst anc e =nil;
    disp a t ch_o nc e(&once Tok en, ^{      s har ed Instance= [[[sel fcl as s]  al loc]i nit];
  }); 
  retur n  share dInst ance ;}- ( UIImage *) t i nted Im ag eFor Ima ge :(UII mage *)i mage ti ntColor:( UIC o lor*) ti ntColor  scale:(CGFlo at )scale {
  UI Image* t intedIma ge = nil;
    
    ORKT i ntedIma geC acheK ey * key = [[O RKT intedI mag e CacheK ey all oc] i ni tWi t h Image : i ma geti ntColor:ti n t Col or sc al e:sc ale];
   tintedImage = [ s elf  objectForKey :ke y]; if( !t i nte dI m age ) {
        tinte dImage = O RK I ma geByTintin g Ima ge 
property (nonatomic,_readonly) UIColor_*tintColor;
@property (nonatomic, readonly) CGFloat_scale;

@end


@implementation ORKTintedImageCacheKey_{
_ __UIImage *_image;
 _  UIColor_*_tintColor;
   _CGFloat _scale;
}

- (instancetype)initWithImage:(UIImage_*)image_tintColor:(UIColor *)tintColor scale:(CGFloat)scale {
    self = [super init];
   _if_(self) {
___    __image = image;
  _ _   _tintColor = tintColor;
  __  _ _scale = scale;
    }
 _  return self;
}

- (BOOL)isEqual:(id)object {
_  _if_([self_class]!= [object class]) {
_     _ return NO;
   _}
    
  _ __typeof(self) castObject = object;
 _  return (ORKEqualObjects(self.image, castObject.image)
_ _    _  _ &&_ORKEqualObjects(self.tintColor, castObject.tintColor)
 _     _  _ && ORKCGFloatNearlyEqualToFloat(self.scale, castObject.scale));
}

@end


@interface ORKTintedImageCache ()

-_(UIImage_*)tintedImageForImage:(UIImage *)image tintColor:(UIColor_*)tintColor_scale:(CGFloat)scale;

@end


@implementation_ORKTintedImageCache

+ (instancetype)sharedCache
{
_  _static_dispatch_once_t onceToken;
__  static id sharedInstance =_nil;
_   dispatch_once(&onceToken, ^{
  _   __sharedInstance = [[[self class]_alloc] init];
   _});
    return sharedInstance;
}

-_(UIImage *)tintedImageForImage:(UIImage_*)image tintColor:(UIColor_*)tintColor scale:(CGFloat)scale {
    UIImage *tintedImage = nil;
 _  
   _ORKTintedImageCacheKey *key = [[ORKTintedImageCacheKey_alloc] initWithImage:image_tintColor:tintColor_scale:scale];
  __tintedImage =_[self objectForKey:key];
    if (!tintedImage)_{
 _     _tintedImage = ORKImageByTintingImage