Skip to content

Releases: rydmike/flex_seed_scheme

Version 3.4.1

25 Sep 22:24
Compare
Choose a tag to compare

3.4.1

Sep 25, 2024

PACKAGE

  • No changes to the FlexSeedScheme package

WEB DEMO

  • Updated the web demo example to use FlexColorPicker version 3.6.0, where the tonal palette can now also respect monochrome seed colors as its displayed Material tonal palette. This is a new feature in FlexColorPicker 3.6.0.
    • In the updated Web demo, the picker's setting is tied into the demo using the setting respectMonochromeSeed so the picker only uses it when the FlexSeedScheme web demo is configured to do so. The setting for the FlexColorPicker to make monochrome tonal palette for monochrome input and to use chroma of selected color, is a separate feature in the picker, it is not tied to FlexSeedScheme, but for this demo they are linked and use the same settings toggle.

Version 3.4.0

22 Sep 23:29
Compare
Choose a tag to compare

3.4.0

Sep 23, 2024

CHANGE

  • The parameter useExpressiveOnContainerColors in SeedColorScheme.fromSeeds now works with a scheme variant regardless of if it has isFlutterScheme set to true or false. Meaning it impacts both MCU DynamicSchemeVariant and FSS FlexTones based scheme variants.

    • For FlexTones based variants, when using a built-in FlexTones or even a custom one, it is no longer necessary to use the FlexTones modifier .expressiveOnContainer() on the used tones to get a seeded color scheme with expressive on container tones in light mode.
    • The FlexTones based modifier .expressiveOnContainer() is still used, but it is applied internally when the flag useExpressiveOnContainerColors is set to true.
    • The useExpressiveOnContainerColors only applies in light mode to on container tones that are equal to 10, other tones are considered custom on purpose and are not changed. This is in-line with that the MCU DynamicSchemeVariants that did not use tone 30 before as on container color in light mode, like Fidelity, Monochrome and Content were not affected by this change in MCU 0.12.0. In the same manner, this flag no longer changes FlexTones based schemes that have on container tones that are not 10. This applies to some on container colors in UltraContrast, Candy Pop and Chroma predefined FlexTones.
    • This change makes this flag consistent and applicable to all seed generated schemes, regardless of if it is based on DynamicSchemeVariant, built-in FlexTones or even custom FlexTones configurations.
    • For MCU seed generated schemes, useExpressiveOnContainerColors only has any impact when contrast level is at the default value (0), normal contrast.
    • When using FFS seed generated schemes with useExpressiveOnContainerColors set to true, the modifier is applied before any FlexTones modifiers. Using tones modifiers, like e.g. onMainsUseBW() will thus as expected, override this setting and set on container colors to tone 0 or tone 100, depending on the container colors brightness.

NEW

  • A new bool parameter, respectMonochromeSeed in SeedColorScheme.fromSeeds can now be used to make seed generated ColorSchemes that work as expected if a monochrome color is used as seed color input.
    • When set to true, any monochrome RGB input value will result in the creation of a greyscale tonal palette for the palette using the monochrome seed color. An RGB monochrome value is one where Red, Green and Blue values are all equal.
    • Previously in FSS and in Material Color Utilities (MCU) and thus still as default in Flutter ColorScheme.fromSeed, using a monochrome seed color value or white, resulted in a tonal palette with cyan color tones. A black input resulted in red like color tones. This is not very intuitive and not really expected when using monochrome seed colors.
    • FSS still defaults to setting respectMonochromeSeed to false, to not break any existing code that may rely on the old behavior.
    • Prefer setting respectMonochromeSeed to true, to get more logical seed results when using monochrome seed colors or white and black as seed colors.
    • NOTE: When using respectMonochromeSeed with DynamicSchemeVariant variants fidelity or content, for some monochrome input colors they produce primaryContainer and onPrimaryContainer as well as tertiaryContainer and onTertiaryContainer color pairs, with low contrast. Consider using some other scheme variants with monochrome seed colors. All others work well with any monochrome seed color. This is just how the MCU DynamicSchemes SchemeContent and SchemeFidelity are defined in MCU. They also produce fairly low contrast for these color pairs with very dark seed colors. This behavior with MCU's SchemeContent and SchemeFidelity could be fixed in FlexSeedScheme's internal MCU fork, but we want to keep the result of these schemes consistent with MCU.

Version 3.3.0

07 Sep 19:04
Compare
Choose a tag to compare

3.3.0

Sep 7, 2024

NEW

  • Exposed DynamicColor, MaterialDynamicColors and Scheme from the underlying forked Material Color Utilities (MCU) library.
  • Undeprecated Scheme, that original MCU deprecated. It does not conflict with the new DynamicSchemes that replaced it, thus in the internal MCU fork, we do not need to deprecate it and can offer it for legacy access to old ColorScheme.fromSeed scheme result in use before Flutter 3.22.0.
    • Internally FlexSeedScheme does not use Scheme for its own legacy version of the same scheme, it uses its FlexTones based setup instead, but produces the same color values. We still recommend using its tones FlexTones.material3Legacy version instead of Scheme for a legacy Material-3 seed generated ColorScheme.
    • This API is provided for legacy access to the old MCU Scheme style and API, that was used in Flutter 3.19.0 and earlier in its ColorScheme.fromSeed constructor back then. If you want to recreate its exact older internal API algorithm, you can now do so using Scheme that it used to use before Flutter 3.22.0.
    • This revived Scheme class was also complemented with the new ColorScheme colors added in Flutter 3.22.0, but it uses legacy Flutter 3.19 and earlier tone mappings for all colors that existed then. Except for dark mode onErrorContainer that it corrected from 80 to 90. It was always a bug in Flutter version 3.19 and earlier that tone 80 was used.

Version 3.2.0

27 Aug 00:55
5783b08
Compare
Choose a tag to compare

3.2.0

Aug 27, 2024

CHANGE

  • The FlexPaletteType.extended tones got three new tones, tones 65, 75 and 84. It now has 30 tones.

NEW

  • The tones configuration class FlexTones got a new modifier, higherContrastFixed(). It can be applied to any predefined or custom FlexTones to make a returned FlexTones instance where the tones for the fixed colors fixed, onFixed, fixedDim and onFixedVariant are set to 92, 6, 84 and 12 instead of their Material-3 specification tones 90, 10, 80 and 30. This for an alternative set of fixed colors with more contrast.

Version 3.1.2

23 Jul 11:28
Compare
Choose a tag to compare

3.1.2

July 23, 2024

FIX

  • FIX the faulty tones for the modified FlexTones.vividSurfaces surface tones. They were in version 3.1.0 set to 96 for a light scheme and 10 for a dark scheme. The values need to be 98 and 6 to not clash with any other important tones used by all the surface colors and provide separation to them. Tones 98 and 6 are also the default tones in M3 design for them, there is very little wiggle room here.

  • FIX tone for the modified FlexTones.vividBackground it was in version 3.1.0 set to 97 for its light scheme, it needs to use value 100 (white) to really provide a "vivid" background mode in light mode and offer some differentiation to FlexTones.vividSurfaces in light mode. In dark mode it still uses tone 5, which is already different and darker than 6 used by FlexTones.vividSurfaces.

INFO

  • How to use legacy FlexTones.vividSurfaces and FlexTones.vividBackground tone mappings?
    • FSS version 3.1.0 removed the deprecated colors background, onBackground and surfaceVariant from being defined as a part of the SeedColorScheme.fromSeeds result. They still get color values, but they are whatever the default values the default Flutter SDK ColorScheme() constructor gives them. These colors were deprecated in Flutter 3.22.0 and are now removed from being defined and accessed by FSS.
    • FSS 3.1.0 also changed the tone mappings for FlexTones.vividSurfaces and FlexTones.vividBackground to make them have some distinguishing differences when background color no longer has any effect or usage, and also to adhere to new the ColorScheme design intent.
    • You should prefer to map one of the new surface colors that are already of a shade close to old surface and background colors, to theme colors as needed by your design. There are eight different surface shades to choose from in the ColorScheme introduced in Flutter 3.22, compared to three before.
    • If you really need the pre-Flutter 3.22 legacy style for FlexTones.vividSurfaces or FlexTones.vividBackground you can optionally recreate them with copyWith on their definitions like this:
// For light legacy FlexTones.vividSurfaces 
final ColorScheme vividSurfacesLight = SeedColorScheme.fromSeeds(
    brightness: Brightness.light,
    primaryKey: mySeedColor,
    tones: FlexTones.vividSurfaces(Brightness.light).copyWith(surfaceTone: 95),
  );
// For dark legacy FlexTones.vividSurfaces 
final ColorScheme vividSurfacesDark = SeedColorScheme.fromSeeds(
    brightness: Brightness.dark,
    primaryKey: mySeedColor,
    tones: FlexTones.vividSurfaces(Brightness.dark).copyWith(surfaceTone: 20),
  );

// For light legacy FlexTones.vividBackground 
final ColorScheme vividBackgroundLight = SeedColorScheme.fromSeeds(
  brightness: Brightness.light,
  primaryKey: mySeedColor,
  tones: FlexTones.vividBackground(Brightness.light).copyWith(surfaceTone: 98),
);
// For dark legacy FlexTones.vividBackground 
final ColorScheme vividBackgroundDark = SeedColorScheme.fromSeeds(
  brightness: Brightness.dark,
  primaryKey: mySeedColor,
  tones: FlexTones.vividBackground(Brightness.dark).copyWith(surfaceTone: 6),
);

Version 3.1.1

12 Jul 21:36
Compare
Choose a tag to compare

3.1.1

July 13, 2024

CHORE

  • FIX the pub score.
  • Update readme.

Version 3.1.1-dev.1

12 Jul 21:16
Compare
Choose a tag to compare
Version 3.1.1-dev.1 Pre-release
Pre-release

3.1.1-dev.1

July 12, 2024

CHORE

  • Experiment to find and remove references from the package to deprecated properties for scoring purposes. The deprecated colors are NOT used anymore, but pub's pana analyzer still complains. It happily ignores the "allow usage of self-deprecated members" setting. It also complains about references used in doc comments. This is the first attempt to find and fixe all things it complains about.

Version 3.1.0

12 Jul 19:16
Compare
Choose a tag to compare

3.1.0

July 12, 2024

CHANGE

  • Removes the in Flutter 3.22.0 deprecated ColorScheme colors background, onBackground and surfaceVariant from being defined as a part of the SeedColorScheme.fromSeeds result. They still get color values, but they are whatever the default values the default Flutter SDK ColorScheme() constructor gives them. These colors were deprecated in Flutter 3.22.0 and are now removed from being defined and accessed by FSS.

    • The removal is done to keep FSS in sync with Flutter SDK and to avoid using deprecated colors.
    • These colors should in application usage be replaced by surface, onSurface and surfaceContainerLowest in Flutter 3.22.0 and later.
      • If you for some reason in Flutter 3.22.0 and later still need the deprecated colors, use FSS version 3.0.0.
  • To make FlexTones.vividSurfaces and FlexTones.vividBackground have some distinguishing differences when background color no longer has any effect or usage, the following changes were made to their tone mappings:

  • FlexTones.vividSurfaces:

  • Light: surfaceTone 95 -> 96,

  • Dark: surfaceTone 20 -> 10.

  • FlexTones.vividBackground:

  • Light: surfaceTone 98 -> 97,

  • Dark: surfaceTone 6 -> 5.

CHORE

  • Update all_lint_rules.yaml.

EXAMPLE

  • Remove showing the deprecated colors background, onBackground and surfaceVariant in the example app.

Version 3.0.0

23 Jun 21:45
Compare
Choose a tag to compare

3.0.0

June 24, 2024

Bring the bundled forked version of the package Material Color Utilities (MCU) to feature parity with version 0.12.0 of the original package. The internal fork for the first time nw also adds features and capabilities that do not exist in the original package. Previously FSS only bundled MCU to avoid version conflicts with Flutter SDK when using different channels. Different Flutter channels typically pin incompatible versions of MCU.

The bundled forked version of MCU also has more tests than the original, allowing us to detect when any new MCU version "silently" changes color results it produced in the past.

  • BREAKING

    • The API for SeedColorScheme.buildDynamicScheme was changed to enable support for multiple seed colors on the MCU based DynamicScheme APIs and its extended schemes. For most normal use cases, you will not notice this, as it is quite a low-level API in FSS that end users normally do not use.
  • NEW

    • The forked internal MCU version received new features. The DynamicScheme can now accept an optional customErrorPalette and then SchemeTonalSpot, SchemeContent, SchemeFidelity, SchemeExpressive, SchemeFruitSalad, SchemeMonochrome, SchemeNeutral, SchemeRainbow and SchemeVibrant that extend DynamicScheme all received properties to support individual seed colors for all tonal palettes.

    • The above addition enables SeedColorScheme.fromSeeds to support using all its key seed colors also when using MCU based DynamicScheme variants and not just for FlexTones based tones and variants. When using key seed colors with MCU variants, they still respect their original design intent.

    • Added support for contrastLevel to SeedColorScheme.fromSeeds. This allows you to set the desired contrast level of the generated color scheme when using SeedColorScheme.fromSeeds with the variant property, for variants that are based on MCU's DynamicScheme. Such variants have their isFlutterScheme set to true.

      • The contrastLevel parameter indicates the contrast level between color pairs, such as primary and onPrimary.The value 0.0 is the default (normal); -1.0 is the lowest; 1.0 is the highest. From Material Design guideline, the medium and high-contrast correspond to 0.5 and 1.0 respectively.
      • The contrastLevel in Flutter SDK is not yet available in ColorScheme.fromSeed in Flutter stable 3.22.x, but is available on the master channel 3.23.x. With FSS you can use it already in Flutter 3.22.x.
      • NOTE: Using contrastLevel has no effect when using tones. However, with tones you can create custom tones with even more flexibility in seed generation to make schemes with higher or less contrast. Two pre-configured high contrast tones exist earlier via FlexTones.highContrast and FlexTones.ultraContrast.
    • Updated MaterialDynamicColors to optionally use the new Material expressive on-colors spec for none surface on-container colors. This feature is not on by default. You can opt in on this new standard by setting useExpressiveOnContainerColors to true in SeedColorScheme.fromSeeds.

      • This option is only available when using MCU based DynamicScheme variants and not when using FlexTones based tones and variants, plus it only applies to variants that are based on MCU's DynamicScheme. Such variants have their isFlutterScheme set to true.
      • Opting in changes the light mode color tone for the colors onPrimaryContainer, onSecondaryContainer, onTertiaryContainer and onErrorContainer from 10 to 30 making them more color expressive, but they also have less contrast.
      • The accepted min contrast curve is thus now ContrastCurve(3, 4.5, 7, 11) instead of ContrastCurve(4.5, 7, 11, 21) for the on-container colors. Meaning normal contrast of 4.5 is now accepted when it was 7 before.
      • Prior to MCU version 0.12.0 the MaterialDynamicColors used an older M3 spec. Flutter stable 3.22.x and Flutter master 3.23.x still use MCU versions lower than 0.12.0 and default to the older color tones 10 in light mode. This will be changed in Flutter SDK when Flutter is updated to use MCU 0.12.0 or later. With FSS 3.0.0, you can opt in on using the new spec already now. But FSS still also defaults to the older spec with more contrast. When Flutter stable changes to use the new spec, FSS will also change to use it as default. While Flutter and MCU will then no longer offer the older higher contrast version, FSS will continue to do so.
      • The optional usage of the expressive colors for on-container colors is also a customization of MCU features in the forked version. We see value in being able to offer both the higher contrast older version and the new more color expressive one.
    • The tones configuration class FlexTones got a new built-in modifier, monochromeSurfaces(). It can be applied to any predefined or custom FlexTones to make the surface colors monochrome and use pure greyscale for the neutral and neutral variant tonal palettes, with no color tint from their key color or primary key seed color.

    • The tones configuration class FlexTones also got the new modifier, expressiveOnContainer(). It can be applied to any predefined or custom FlexTones to make a returned FlexTones instance where the tones for light mode on container tones are set to 30 for more color expressive container text and icons on none surface containers.

      • This modifier only impacts none surface on-container tones that are dark and thus only has any impact on the light theme mode on-container colors.
      • The impacted on container colors are onPrimaryContainerTone,onSecondaryContainerTone, onTertiaryContainerTone and onErrorContainerTone.
      • This feature brings optional light mode expressive on-container colors to any predefined or custom FlexTones configuration. The expressive on-color in light mode containers are a new change to Material Design 3 ColorScheme. It was introduced in Material Color Utilities (MCU) package v0.12.0.
      • This modifier is equivalent to setting the SeedColorScheme.fromSeeds and its useExpressiveOnContainerColors to true when using MCU dynamic scheme variant based seeded color schemes.
  • COLOR VALUE STYLE BREAKING

    • Changed FlexTones.chroma tone secondaryTone from 60 to 50 in light mode for better chroma fidelity when using FlexTone.chroma in light mode.
  • CHANGE

    • Revert Flutter constraint back to >=3.22.0 from >=3.22.0-0.3.pre that was only used by FSS dev release 2.1.0-dev.1. Since beta and master are now on 3.23.0 or higher versions, the >=3.22.0 constraint can now be used by master and beta channels without any issue.
    • Improved the descriptions and config info strings of FlexSchemeVariant enum values.
    • The EXAMPLE APP was extensively revised to include support for all the new features and to also show some old features not demonstrated before.
  • FIX

    • The FlexTones.material3Legacy was corrected. It had some incorrect tones and chroma in its configuration. The mistakes were fixed. Tests were added to check the FlexTones.material3Legacy compared to the MCU deprecated Scheme-based colors, for colors that exist in both.
    • EXAMPLE APP: The key color to seed the error palette was not used in the main example in dark mode.

Version 2.0.0

14 May 13:13
52794f7
Compare
Choose a tag to compare

2.0.0

May 14, 2024

This release adds support for the revised Material-3 ColorScheme released in Flutter version 3.22.0 and for seeded scheme variants, that will arrive in the Flutter stable release after 3.22.x.

  • CHANGE

    • Bring the internal Material Color Utilities (MCU) library version to parity with its latest package release 0.11.1. Flutter SDK stable 3.22 still uses MCU 0.8.0, but the Flutter master channel already uses MCU 0.11.1.
    • The FlexPaletteType.extended tones got two new tones added, tone 2, and 24. It now has 27 tones.
  • NEW

    • Support revised Material-3 ColorScheme with the new colors primaryFixed, primaryFixedDim, onPrimaryFixed, onPrimaryFixedVariant, secondaryFixed, secondaryFixedDim, onSecondaryFixed, onSecondaryFixedVariant, tertiaryFixed, tertiaryFixedDim, onTertiaryFixed, onTertiaryFixedVariant, surfaceDim, surfaceBright, surfaceContainerLowest, surfaceContainerLow, surfaceContainer, surfaceContainerHigh and surfaceContainerHighest.

    • New alternative way to specify the used seeding algorithm in SeedColorScheme.fromSeeds by providing new enum value FlexSchemeVariant to its variant property.

      • In addition to supporting selection of built-in FlexTones, the variant property also supports using Flutter SDK, MCU based scheme variants tonalSpot, monochrome, neutral, vibrant, expressive, content,rainbow and fruitSalad in by specifying them in property variant in SeedColorScheme.fromSeeds. In Flutter 3.22 only the default tonalSpot is available, but with FSS you can use any of the other variants as well already in Flutter 3.22. The other variants are not yet available in Flutter 3.22, but they are available in the ColorScheme API in the master channel and will be available in Flutter ColorScheme.fromSeed in the next stable release after 3.22. With FSS you can use them already starting from Flutter 3.22.0.
      • With the variants enum property you can also select built-in FlexTones that you could use before in SeedColorScheme.fromSeeds in tones. The FlexTones are still available and can be used as before, it has some advantages. With tones you can create customized seed extractions based on FlexTones and you can use tones surface quick modifiers, onMainsUseBW, onSurfacesUseBW and surfacesUseBW.
      • When using variants, if the variant is one of the Flutter SDK/MCU variants, it will not use more than one key color, the primary as seed color. The FlexSchemeVariant that have their property isFlutterScheme set to true are part of the Flutter SDK/MCU variants.
      • The Flutter SDK/MCU variants are tonalSpot, fidelity, monochrome, neutral, vibrant, expressive, content, rainbow and fruitSalad.
      • The other FlexSchemeVariant that have their property isFlutterScheme set to false are part of the FlexTones variants using the corresponding built-in FlexTones as seed extraction. The variants are material, material3Legacy, soft, vivid, vividSurfaces, highContrast, ultraContrast, jolly, vividBackground, oneHue, candyPop and chroma. The chroma option is similar to the new nice SDK/MCU one called fidelity, in that it follows chroma of seed color, with the added benefit that it can use a separate seed color for each tonal palette.
      • The APIs variant and tones are mutually exclusive, you can only use one of them in SeedColorScheme.fromSeeds. Both can be unspecified, but if you specify one, the other must be unspecified/null.
  • A new FlexTones.material3Legacy was added. This FlexTones configuration preserves and provides access to the seed generation used by Flutter prior to Flutter version 3.22 and as used by FlexTones.materialin FlexSeedScheme before version 2.0.0. If you in Flutter 3.22 and FlexSeedScheme 2.0.0 need to replicate this style you can use this FlexTones in SeedColorScheme.fromSeeds property tones or the FlexSchemeVariant.material3Legacy in variants.

  • BREAKING

    • The Material-3 ColorScheme colors background, onBackground and surfaceVariant have been deprecated since they are also deprecated in Flutter 3.22.
      • These deprecated colors are still supported in SeedColorScheme.fromSeeds and FlexTones, but they will be removed in a future release. They are replaced by surface, onSurface and surfaceContainerLowest. There are also many new surface colors, like surfaceDim, surfaceBright and surfaceContainerLowest in the new Material-3 ColorScheme in Flutter 3.22.
      • The fact that these deprecated colors are still referenced in the package will reduce its pub.dev score with 10 points, but they are kept for now to maintain FULL compatibility with Flutter 3.22 that also still provides values for these deprecated colors and uses them in code. This package needs to provide the same values to be fully compatible. The ColorScheme colors background, onBackground and surfaceVariant may only be fully removed when they have been removed from the Flutter SDK stable channel. If later tests show they can be removed without breaking any styles earlier, they will be removed in a future release of this package, even if they are still available in the Flutter SDK stable channel. A future dev version may also remove them to provide compatibility with the Flutter master channel when they are removed there.
  • BREAKING STYLES

    • All built-in FlexTones now use the paletteType extended via FlexPaletteType.extended as default for additional tone fidelity. This is needed for compatibility with Flutter 3.22 and its revised ColorScheme.

    • The default tones for the built-in FlexTones have been adjusted to match the new Material-3 ColorScheme in Flutter 3.22. The new tones and default styles are marginally different but also better than in previous Flutter versions. If you need the result and style used in Flutter 3.19 and earlier, you can use the FlexTones.material3Legacy as tones in SeedColorScheme.fromSeeds to get the result FlexTones.material produced in FSS before version 2.0.0 and that was also the default in Flutter in version 3.19 and earlier.

    • The FlexSchemeVariant.tonalSpot is the variant that Flutter SDK uses from MCU in ColorScheme.fromSeed in Flutter 3.22 and later when you make seed generated color schemes with it. This generated scheme is different from the one ColorScheme.fromSeed generated in Flutter 3.19 and earlier. If you need the result and style used in Flutter 3.19 and earlier, you can use the material3Legacy as tones or variant in SeedColorScheme.fromSeeds to get the result FlexTones.material produced in FSS before version 2.0.0 and that was also the default in Flutter in version 3.19 and earlier when using ColorScheme.fromSeed.

    • The FlexTones.material has been updated and now produces the same result as tonalSpot in tests. There may be some edge cases where there are rounding differences. The material alternative can be used both in variant and tones. It provides the advantages over tonalSpot that since it is a FlexTones, it can use multiple seed colors and if used in tones, its results can be quick adjusted with onMainsUseBW, onSurfacesUseBW and surfacesUseBW. The tonalSpot is a Flutter SDK/MCU variant and does not support these customizations.