Repository navigation
Move payment icons from luminance-based selection to ThemeMode behind a feature flag - #15029
Merged
Merged
Conversation
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
samer-stripe
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move payment icon selection away from component luminance and toward the resolved
PaymentSheet.Appearance.themeMode. WithFeatureFlags.disableLuminanceBasedThemesenabled, the effective theme determines light/dark artwork, icon URLs, tint, and the inline Affirm logo, even when custom component colors have different brightness.The flag defaults off.
Icon behavior
With Disable Luminance Check enabled, component brightness does not affect icon selection:
ThemeModeAutomaticcolorsLightAutomaticcolorsDarkAlwaysLightcolorsLightAlwaysLightcolorsLightAlwaysDarkcolorsDarkAlwaysDarkcolorsDarkMotivation
A dark theme with a bright component background currently selects light-theme artwork and black icon tint. Enabling the flag selects dark-theme artwork and white tint for the same background, allowing icon behavior to be tested independently of custom component colors. Forced
AlwaysLightandAlwaysDarkmodes take precedence over the system theme.The
PaymentOption.icon()fallback also previously consulted the system theme and mutable global colors rather than the supplied appearance. It now honors that appearance consistently.Testing
:payments-ui-core:detektpassed.icon()andiconPainter, resource/URL selection, and the appearance-based fallback.Screenshots
Dark system theme with the bright yellow
CrazyAppearancecomponent:Committed and created by Codex.