1

I want to tint my button in drawRect, but cannot find the right setup to tint the image

- the button is borderless, with a grayscale image, which i want to tint

In my NSButton subclass :

- (void)drawRect:(NSRect)dirtyRect{

    if ([self.cell mouseDownFlags] == 0) {

        [[NSColor redColor] set];

    } else {

        [[NSColor blackColor] set];

    }

    NSRectFillUsingOperation(dirtyRect, NSCompositePlusDarker);

    [super drawRect:dirtyRect];
}
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179

1 Answers1

0

Try using setFill:

[[NSColor redColor] setFill];

...

l'L'l
  • 44,951
  • 10
  • 95
  • 146