Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ class ConfirmButton: UIView {
}

// if foreground is set prefer that over a dynamic contrasting color in all other states
// Note: With the default .systemBlue button color in dark mode, background.contrastingColor is white
// in iOS <26 and black in iOS >26 due to system color changes. This is expected and intended.
return overriddenForegroundColor ?? background.contrastingColor
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ import UIKit
// Prefer using a white foreground as long as a minimum contrast threshold is met.
// Factor the container color to compensate for "local adaptation".
// https://github.com/w3c/wcag/issues/695
// Note: Pre-iOS 26, .systemBlue has a contrastToWhite of >3.6 but after iOS 26 it is <3.6.
// This means that on iOS 26 and later, .systemBlue will switch to black text in dark mode.
let threshold: CGFloat = isDarkMode ? 3.6 : 2.2
if contrastRatioToWhite > threshold {
return .white
Expand Down
Loading