How to change the color of an NSProgressIndicator from gray to white?

The default color for the NSProgressIndicator is gray, but I want it to be white.

Is there anyone who knows how to do this? Please let me know.

Many thanks.

+4
source share
1 answer

Subclass the NSProgressIndicator internal method how to do this

- (void)drawRect:(NSRect)dirtyRect { // Drawing code here. [self setControlTint:NSGraphiteControlTint]; CGContextSetBlendMode((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], kCGBlendModeSoftLight); [[[NSColor whiteColor] colorWithAlphaComponent:1] set]; [NSBezierPath fillRect:dirtyRect]; [super drawRect:dirtyRect]; } 
-one
source

Source: https://habr.com/ru/post/1502548/


All Articles