-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable]Enhance ColorScheme.fromSeed with a new variant parameter
#148916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP-stable]Enhance ColorScheme.fromSeed with a new variant parameter
#148916
Conversation
…144805) Fixes flutter#144649 This PR is to add an enhancement for `ColorScheme.fromSeed()`. When we input a brighter color with a high chroma and we want the resulting `ColorScheme` respects the source color, we can achieve this by setting ```dart ColorScheme.fromSeed( seedColor: sourceColor, variant: Variant.fidelity, ... ) ``` Here is a demo for `ColorScheme` constructed by all 9 variants:  
|
@QuncCccccc please fill out the PR description above, afterwards the release team will review this request. |
…e has 0.8.0 version on stable
…ial color utilities package has 0.8.0 version on stable
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@QuncCccccc @goderbauer @Piinks while i do understand that we made a complete mistake in communicating this change to users, this cherry-pick seems to be cherry-picking an entire feature into the release branch, which we do not typically accept. Due to the miscommunication around the fix timeline, I am inclined to accept this either way. |
|
My understanding is that this fixes a breaking change that was accidentally made in the latest release. A change to color scheme landed, a while later we got feedback it broke some things. This fix made the breaking change backwards compatible, and we wrote a migration guide, thinking that this follow up change made the release cut, when it actually just missed it. |
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#148359
Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples
Provide an option in
ColorScheme.fromSeedmethod to respect the seed color even if the seed color is very bright.Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)
The updated algorithm in
ColorScheme.fromSeedcreates a darker version ofColorScheme. This may result in apps looking different from their original color theme.Workaround:
Is there a workaround for this issue?
Manually construct a desired
ColorSchemeinstead of usingColorScheme.fromSeed, or use the deprecatedSchemeclass in MCU package to build theColorSchemeRisk:
What is the risk level of this cherry-pick?
This cherry-pick does not break the current implementation but only provides an option if users want the
ColorSchemebuilt byColorScheme.fromSeedrespect the seed color.Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
With
dynamicSchemeVariant: DynamicSchemeVariant.fidelity, the color scheme constructed byColorScheme.fromSeed()respects the seed color.