Supporting Differentiate Without Color in SwiftUI
Learn how to communicate status with symbols and shapes instead of relying on color alone.
12 Oct 2026 · 4 min read
Color can make the state of an interface easy to recognize at a glance. But if color is the only difference between two states, that information may not be available to everyone.
In this article, we'll use SwiftUI's accessibilityDifferentiateWithoutColor environment value to add a second visual cue when the corresponding system setting is enabled.

Starting with a color-only status
Suppose we use a colored circle to show whether something is available:
Circle().fill(isAvailable ? .green : .red).frame(width: 28, height: 28).accessibilityLabel(isAvailable ? "Available" : "Unavailable")
The accessibility label communicates the state to assistive technologies such as VoiceOver, but the visible interface still relies entirely on the difference between green and red.
We can make the two states visually distinct by adding a checkmark or an xmark when the user asks the system to differentiate without color.
Reading the system preference
Users can enable Differentiate Without Color in the Settings app under Accessibility → Display & Text Size → Differentiate Without Color.
SwiftUI exposes that preference as a Boolean environment value:
@Environment(\.accessibilityDifferentiateWithoutColor)private var differentiateWithoutColor
Because it is an environment value, SwiftUI updates views that read it when the setting changes.
Adding a second visual cue
We can now overlay a symbol when the preference is enabled:
struct AvailabilityIndicator: View {@Environment(\.accessibilityDifferentiateWithoutColor)private var differentiateWithoutColorlet isAvailable: Boolvar body: some View {Circle().fill(isAvailable ? .green : .red).frame(width: 28, height: 28).overlay {if differentiateWithoutColor {Image(systemName: isAvailable ? "checkmark" : "xmark").font(.caption.bold()).foregroundStyle(.white)}}.accessibilityLabel(isAvailable ? "Available" : "Unavailable")}}
With the setting disabled, the indicator keeps its original appearance. With the setting enabled, its meaning no longer depends on distinguishing the two colors.
Depending on the interface, the additional cue can also be a text, different shapes, patterns or a change in position may communicate the distinction more clearly.
Designing beyond the preference
Depending on the design, it may also make sense to show the checkmark and xmark by default. This makes the states distinguishable without color for everyone and removes the need for a conditional adaptation.
accessibilityDifferentiateWithoutColor is useful when the additional visual cue works better as an alternative presentation, for example when symbols would otherwise add too much visual density to a compact interface.
Testing both appearances
We can use previews to compare the indicator with the preference disabled and enabled:
#Preview("Default appearance") {HStack(spacing: 20) {AvailabilityIndicator(isAvailable: true)AvailabilityIndicator(isAvailable: false)}.padding()}#Preview("Differentiate without color") {HStack(spacing: 20) {AvailabilityIndicator(isAvailable: true)AvailabilityIndicator(isAvailable: false)}.padding().environment(\.accessibilityDifferentiateWithoutColor, true)}
When testing the settings on a device or simulator, Xcode's Accessibility Inspector can override Differentiate Without Color as well, which makes it useful for checking several screens without repeatedly changing the system setting.
A grayscale color filter can reveal places that rely heavily on color, but it isn't a simulation of how every person with a color vision difference sees the interface. It is a useful additional check, not a replacement for providing another visual cue.
Conclusion
SwiftUI's accessibilityDifferentiateWithoutColor environment value tells us whether the user enabled the corresponding system setting. We can use it to provide an alternative presentation with symbols, shapes, text or other visual cues.



Newsletter
Like to support my work?
Say hi
Related tags
Articles with related topics
Latest articles and tips



