Is there an api to let text dynamically change color based on its background?

Asked on 2025-07-29

1 search

Yes, there are APIs that allow text to dynamically change color based on its background to ensure legibility. In the session titled "Build a UIKit app with the new design" from WWDC 2025, it is mentioned that labels automatically become vibrant based on their text color to ensure legibility against a variety of backgrounds. This involves using dynamic colors that adapt to the background, switching between light and dark modes automatically to increase contrast. You can find more details in the session Build a UIKit app with the new design (21:44).