Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the color of NSProgressIndicator?

What is the best way to change the color of NSProgressIndicator, is there an easier way than just to subclass it and then draw the whole component by myself?

Basically what I want to do is to have a similar component but with the ability to change the color of the bar.

I tried to google this but all the questions were quite outdated and didn't really concern the 10.10 OS X version that I am working on. Also checked cocoa controls and did only find 1 component that was for outdated OS X version.

like image 416
Samuli Lehtonen Avatar asked Jul 19 '15 21:07

Samuli Lehtonen


1 Answers

You can use Quartz filters (e.g. hue adjust) for this directly in Interface Builder. This works better than expected.

NSProgressIndicator

It's in the Effects Inspector. Under "Content Filters" you can add "Hue Adjust"

enter image description here

like image 148
paxos Avatar answered Sep 21 '22 17:09

paxos