-
Are they the same? highScaffoldLowSurface |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes this is a correct observation. In version 8 and later they are the same. // Result: Surfaces (1/2x) Scaffold (3x)
case FlexSurfaceMode.highScaffoldLowSurface:
return FlexAlphaValues(
primaryAlpha: blendLevel,
primaryContainerAlpha: blendLevel * 2,
secondaryAlpha: blendLevel,
secondaryContainerAlpha: blendLevel * 2,
tertiaryAlpha: blendLevel,
tertiaryContainerAlpha: blendLevel * 2,
errorAlpha: blendLevel,
errorContainerAlpha: blendLevel * 2,
surfaceAlpha: blendLevel ~/ 2,
inverseSurfaceAlpha: blendLevel ~/ 2,
dialogAlpha: blendLevel ~/ 2,
scaffoldAlpha: blendLevel * 3,
); and // Result: Surfaces (1/2x) Scaffold (3x)
case FlexSurfaceMode.highScaffoldLowSurfaces:
case FlexSurfaceMode.highScaffoldLowSurfacesVariantDialog:
return FlexAlphaValues(
primaryAlpha: blendLevel,
primaryContainerAlpha: blendLevel * 2,
secondaryAlpha: blendLevel,
secondaryContainerAlpha: blendLevel * 2,
tertiaryAlpha: blendLevel,
tertiaryContainerAlpha: blendLevel * 2,
errorAlpha: blendLevel,
errorContainerAlpha: blendLevel * 2,
surfaceAlpha: blendLevel ~/ 2,
inverseSurfaceAlpha: blendLevel ~/ 2,
dialogAlpha: blendLevel ~/ 2,
scaffoldAlpha: blendLevel * 3,
); This is because Flutter 3.22 removed the When With the introduction of all the new surface colors, you do however have even more options for different surface color shades and tints to use on components and background. You just have to change default selections in component themes. Before Flutter 3.22 there was no hard definition in the design standard what the shade relations between It still work liek this for Before V8 there was also In fact in 7.3.1 and earlier the blend factors looked like this: // Result: Scaffold (3x) background (3/2x) surface (1x).
// surfaceVariant (Surface*2)
case FlexSurfaceMode.highScaffoldLevelSurface:
return FlexAlphaValues(
primaryAlpha: blendLevel,
primaryContainerAlpha: blendLevel * 2,
secondaryAlpha: blendLevel,
secondaryContainerAlpha: blendLevel * 2,
tertiaryAlpha: blendLevel,
tertiaryContainerAlpha: blendLevel * 2,
errorAlpha: blendLevel,
errorContainerAlpha: blendLevel * 2,
surfaceAlpha: blendLevel,
surfaceVariantAlpha: blendLevel * 2,
inverseSurfaceAlpha: blendLevel,
dialogAlpha: blendLevel,
backgroundAlpha: blendLevel * 3 ~/ 2,
scaffoldAlpha: blendLevel * 3,
); and // Result: Scaffold (3x) Surface and background (1/2x).
// surfaceVariant (Surface*2)
case FlexSurfaceMode.highScaffoldLowSurfaces:
case FlexSurfaceMode.highScaffoldLowSurfacesVariantDialog:
return FlexAlphaValues(
primaryAlpha: blendLevel,
primaryContainerAlpha: blendLevel * 2,
secondaryAlpha: blendLevel,
secondaryContainerAlpha: blendLevel * 2,
tertiaryAlpha: blendLevel,
tertiaryContainerAlpha: blendLevel * 2,
errorAlpha: blendLevel,
errorContainerAlpha: blendLevel * 2,
surfaceAlpha: blendLevel ~/ 2,
surfaceVariantAlpha: blendLevel ~/ 2 * 2,
inverseSurfaceAlpha: blendLevel ~/ 2,
dialogAlpha: blendLevel ~/ 2,
backgroundAlpha: blendLevel ~/ 2,
scaffoldAlpha: blendLevel * 3,
);
} While we now have less degrees of freedom due to spec saying what the surface color relationships should be, we do have a lot of more shaded surface colors we can use. The blend modes are still useful for assigning blend factor and blend level of how much blend all the surface colors will get in relation to used I originally added the blend modes, to give users more variation on surface tints, with fewer usable colors in ColorScheme. The new ColorScheme adds a lot of different colors to do it that way. We can now use both ways in FlexColorScheme. The blend mode and blend levels originally also existed before seed generated M3 In FlexColorSchme you can use either alpha blended surface, or very configurable seed generated ColorSchemes, that are also typically surface tinted, with varying degree depending on chosen style, or they can also get monochrome surface. And you can even combine seed generation and surface blends. Summary This was a good observation. It is however expected behavior in the new version done on purpose to not break pats APIs and conform to less degrees of freedom in Flutter Material design, when |
Beta Was this translation helpful? Give feedback.
Yes this is a correct observation. In version 8 and later they are the same.