mirror of https://github.com/LIJI32/SameBoy.git
21 lines
428 B
Mathematica
21 lines
428 B
Mathematica
![]() |
#import "GBTintedImageCell.h"
|
||
|
|
||
|
@implementation GBTintedImageCell
|
||
|
|
||
|
- (NSImage *)image
|
||
|
{
|
||
|
if (!self.tint || !super.image.isTemplate) {
|
||
|
return [super image];
|
||
|
}
|
||
|
|
||
|
NSImage *tinted = [super.image copy];
|
||
|
[tinted lockFocus];
|
||
|
[self.tint set];
|
||
|
NSRectFillUsingOperation((NSRect){.size = tinted.size}, NSCompositeSourceIn);
|
||
|
[tinted unlockFocus];
|
||
|
tinted.template = false;
|
||
|
return tinted;
|
||
|
}
|
||
|
|
||
|
@end
|