Contents

isLuminanceReduced

A Boolean value that indicates whether the display or environment currently requires reduced luminance.

Declaration

var isLuminanceReduced: Bool { get set }

Discussion

When you detect this condition, lower the overall brightness of your view. For example, you can change large, filled shapes to be stroked, and choose less bright colors:

@Environment(\.isLuminanceReduced) var isLuminanceReduced

var body: some View {
    if isLuminanceReduced {
        Circle()
            .stroke(Color.gray, lineWidth: 10)
    } else {
        Circle()
            .fill(Color.white)
    }
}

In addition to the changes that you make, the system could also dim the display to achieve a suitable brightness. By reacting to isLuminanceReduced, you can preserve contrast and readability while helping to satisfy the reduced brightness requirement.

See Also

Reacting to interface characteristics