Skip to content

Different colors when using Theme.of(context).colorScheme to access the theme colors (Seed input colors are not in produced theme.colorScheme, how to include them?) #89

Closed Answered by rydmike
Errechydy asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Errechydy,

Thank you for your question.

When you pass in const FlexKeyColors() to keyColors, you are enabling usage of key color based seed generated Material 3 ColorScheme.

If you do not want to use Material 3 based seeding generated ColorScheme, but want to use the exact colors you defined you can just delete keyColors: const FlexKeyColors(), in your setup.

If on the other you do want to use it, then when using the default FlexKeyColors() it is the same as using ColorScheme.fromSeed with your primary color, in the light theme case:

ColorScheme.fromSeed(seedColor: Color(0xff1145a4), brightness: Brightness.light)

The resulting ColorScheme from that operation, will not contain any of t…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Errechydy
Comment options

@rydmike
Comment options

@Errechydy
Comment options

@rydmike
Comment options

Answer selected by rydmike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question This issue is a usage question and will be moved to the Discussions section.
2 participants
Converted from issue

This discussion was converted from issue #88 on September 14, 2022 22:42.