When I set my progress indicator's background to green, it works as expected.
Code:
loadingIndicator.wantsLayer = true
loadingIndicator.layer?.backgroundColor = NSColor.greenColor().CGColor
Result:
But when I set the background color to white, the background color stays gray (instead of changing to white).
Code:
loadingIndicator.wantsLayer = true
loadingIndicator.layer?.backgroundColor = NSColor.whiteColor().CGColor
Result:
Why does setting the background color to white not work, but green does? How can I correct this issue? I'm on OS X 10.11.4.
EDIT: This apparently only happens when the progress indicator is inside a view that was presented as a popover.
I think, that apart from background color you should be also able to edit grid: both transparency and color. With both these options this you can fully customize looks & feels of the background. Having some medical eye issues, being able to change the background color or have a dark mode would be really appreciated!
Fotor's online photo editor lets you change background color to white in an instant. No matter if you want to add a white background to profile pictures or product photos, you’ll just be covered. In addition to this, you can further customize your photos using a variety of editing features.
Changing background color with few defined presets (for example dark one) seems to be more versatile. I think it will be more better if we can change the background into any color, for example: change to black,white,green,blue and more. that will be better because when you use the light color, I nearly cannot see the color
After the background has been removed, click on the color box to add a color to the transparent background. Quickly change background color to white, red, blue, black or any other color you like. Once you've added the most befitting color, click on the “Download” button at the top and choose a high-resolution format to download the finished image.
I had same issue when I use NSProgressIndicator inside NSPopover.
My solution was to set appearance to popover like below.
popover.appearance = NSAppearance(named: NSAppearanceNameAqua)
I'm not sure why this happens, but after setting the property I got correct white background color.
Screenshot: white background progress inside popover
I've found a way to fix this. The CALayer of the NSProgressIndicator has a sublayer that is showing the tinted background color you are seeing. Hiding that sublayer will cause no background to ever be shown, and keep the spinner visible.
CALayer *layer = [[self popoverProgressIndicator] layer];
CALayer *backgroundLayer = [[layer sublayers] firstObject];
[backgroundLayer setHidden:YES];
I've only seen this issue when inside of an NSPopover where I was using the solution here to change the background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With