Day 149

Keep media readable with Smart Invert

15 Oct 2022

Classic Invert reverses the colors of the display. But there's also Smart Invert. To support it, for avoiding images and media from being inverted, you just have to set accessibilityIgnoresInvertColors to true, for these elements. A quick win!

Three examples of the Books app showing the Steve Jobs book by Walter Isaacson. The first one is the default mode. The second one shows all the colors inverted with Classic Invert. The third one shows the colors inverted for everything but the image for the book cover. Some code shows how you just need to set accessibilityIgnoresInvertColors to true for the book cover image.

Some of you have asked me how you can support what I do. This would really help, and would be hugely appreciated:

  • Find these posts useful? Share them at work, on social media, or with anyone that might find them interesting. Let's spread the word!

  • Check out any of my apps or games: Xarra!, RetroRapid!, or Mestre!.

    • A download and a review go a long way. They're free by default. On the App Store, ratings and reviews really help more people discover them.

    • Finding any of them useful? If so, and if you can afford it, purchasing lifetime access to all features or subscribing lets me buy the coffee that keeps me caffeinated. Caffeine keeps me going to maintain the apps, bring in new features that I hope you'll love, and keep writing.

You may also find interesting...

In addition to being able to test some accessibility options in the simulator using Environment Overrides. You can even preview some of these options before even running the app in the simulator with this Accessibility panel in Interface Builder.

The most straightforward way for making sure your colors work well in all appearances (dark, light, increase contrast, and all the combinations) is to use the provided system colors. Check the background and label semantic colors too. All the info in the Color section of Apple’s Human Interface Guidelines: https://developer.apple.com/design/human-interface-guidelines/color

Apple recommends in their guidelines a minimum tappable area size of 44x44 points for all controls. A lot of times this can be corrected in an app without changing how it looks, but making it objectively easier to interact with for everyone.


Content © Daniel Devesa Derksen-Staats on Accessibility up to 11! is licensed under CC BY 4.0. License details