-
I want to use the theme colors as background for some I'm using the latest version of the package
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @Errechydy, Thank you for your question. When you pass in 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 If on the other you do want to use it, then when using the default ColorScheme.fromSeed(seedColor: Color(0xff1145a4), brightness: Brightness.light) The resulting ColorScheme from that operation, will not contain any of the actual provided colors in your input colors, in the The process of this described in the docs e.g. here https://docs.flexcolorscheme.com/playground#seeded-colorscheme and here https://docs.flexcolorscheme.com/api_guide#generated-colorscheme You can also learn much more about this from myFlutter Vikings talk https://rydmike.com/blog_vikings_2022_talk and its slides on M3 ColorScheme https://docs.google.com/presentation/d/1F7LXlMkD4Z5Eqkvw8uwMQBgBX52IiLqe3yODuakmLQo/edit#slide=id.p45 How do I get the colors I defined and still use a M3 seed generated ColorScheme?Using FlexColorScheme you can for starters tell FCS Additionally you can use another keyColors: const FlexKeyColors(
useSecondary: true,
useTertiary: true,
),
tones: FlexTones.vivid(Brightness.light), This would still not give you the exact colors that you have as seed key colors, in the ColorScheme, but it would be pretty close now already, it would look like: When using seeded color schemes the inputs are not ending up in the produced ColorScheme, but you can also tell it to do so in the produced output seeded color scheme via keyColors: const FlexKeyColors(
useSecondary: true,
useTertiary: true,
keepPrimary: true,
keepSecondary: true,
keepTertiary: true,
),
tones: FlexTones.vivid(Brightness.light), Above, I did not lock down the container colors, but instead let them still use the seed generated values from their tonal palettes. I did so because the colors you used are not entirely compatible with what the M3 color system expects to find in those colors in relation to their none container color values. The secondary color is also quite special in M3 design fulfilling ColorSchemes, and the M3 widget styling and design expects it to be more muted and less prominent version of "primary". Using color hue's that are bit off color from primary and more muted/pastel/greyish will work well though even if they do not use the exact same hue as primary color. Tertiary has more freedom and can well be used as additional color the gets more attention. The container color should always have a certain relation to their none container version. It is also a good idea to in the main colors avoid very close color overlap with the M3 error colors. Material 3 color system fulfilling ColorSchemes are quite picky and difficult to design by hand, therefore seeding is often preferred. Locking down a few brand color values for the actual primary and e.g. tertiary color works pretty well though. For the rest of them I recommend going with seed generation, if you know the color system and what is expected where, you can of course hand tweak it or even design it fully by hand as well. If you use totally wild ColorScheme in M3 mode, that is not design as the M3 Color system expects, widgets that have been migrated to support M3 styles when M3 is enabled may end up looking a bit odd by, it all depends on used colors of course. If you use the ThemesPlayground you can play with Seed generation, keeping the inputs, different tones mapping and chroma selections, to find these settings that suite your needs, also with the custom colors as input that you used in above example. You can also use a completely custom made Hope this helps and explains what it is going. The behavior is as designed and expected, Material 3 seed generated ColorScheme are however an entirely new ball game in Material app design. I do recommend studying the M3 guide, for many hours: https://m3.material.io/, well if it is of interest 😄 I will close this issue and move it to discussions, in hope that the answer can be helpful and found later by others as well. Good question, definitely not a simple design topic, but easy enough to configure in FCS. |
Beta Was this translation helpful? Give feedback.
Hi @Errechydy,
Thank you for your question.
When you pass in
const FlexKeyColors()
tokeyColors
, 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 usingColorScheme.fromSeed
with yourprimary
color, in the light theme case:The resulting ColorScheme from that operation, will not contain any of t…