diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift index fa21626289a..e0f4b759519 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift @@ -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 } diff --git a/StripeUICore/StripeUICore/Source/Categories/UIColor+StripeUICore.swift b/StripeUICore/StripeUICore/Source/Categories/UIColor+StripeUICore.swift index 2467fd6d89f..2b8f7665e3a 100644 --- a/StripeUICore/StripeUICore/Source/Categories/UIColor+StripeUICore.swift +++ b/StripeUICore/StripeUICore/Source/Categories/UIColor+StripeUICore.swift @@ -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