0
votes

Currently I have a button that changes the background color of my app (my users complained that it melted into other windows when grey, but others wanted that color scheme). I have 3 color options: grey with black text, light blue with blue text, and purple with white text.

Problem 1: Dark mode is messing with my color scheme - can I set something up to adjust based on if they have dark mode on? Otherwise, I'm going to have to end up with grey text with a grey background in order for it to be ok when it switches back to grey.

Problem 2: Button text - this wasn't so bad when using light mode because the buttons didn't change color, but on dark mode, this gets hard to read the button. White text on a light blue background hurts my eyes

I'm unable to attach images due to my level

I'm using Xcode 11.5, swift 5, and I'm coding for a Mac Application

1

1 Answers

0
votes

Sounds like you are using the system color for the text / background color. And in dark mode, IOS will automatically change the system color for different mode. For reference: https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/#dynamic-system-colors

Indeed for both problem 1&2, if you want to use custom color (not the system one) for each mode, you can put your color sets into an asset file (and I would suggest adding a new one, rather than adding all color together with your image). For each set of color, set them to the desired appearance (any, light, dark), then set the color by code.

Apple give a detail documentation about that: https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface