Day 167

Calculate color contrast in Inspector

1 Nov 2022

There is a Color Contrast Calculator conveniently built into the Accessibility Inspector. Find it in Window, in the top menu. Select two colors for text and background and check if it passes for all text sizes or just some of the largest ones.

With the Accessibility Inspector open, select Window in the top menu, and then Show Color Contrast Calculator. It will open on a separate window. Two colors can be selected for text and background in a few ways, like specifying RGB or Hex values. You can then move the text size slider to find out if it passes for all the text sizes or just some of the largest sizes.

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...

There is an Environment Overrides panel in the toolbar on top of Xcode's Debug Area. It allows you to select some of the most common accessibility options and Dynamic Type sizes, like in the Accessibility Inspector, plus select dark/light mode.

The Accessibility Inspector lets you configure on or off some of the most common accessibility options so you can conveniently observe how your app adopts these options in the simulator or device. You can also quickly select different text sizes.

The Accessibility Inspector has a Notifications log that you can find in Window, in its top menu, and then Show Notifications. It shows accessibility-related notifications like layout changed, screen changed, or announcements... I learned about this feature from the Accessibility Inspector in this article by @basthomas. A very recommended read to learn all about the Verifying VoiceOver with the Accessibility Inspector. https://www.basbroek.nl/verifying-voiceover


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