You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/flutter/lib/src/material/color_scheme.dart
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -898,29 +898,37 @@ class ColorScheme with Diagnosticable {
898
898
/// Generate a [ColorScheme] derived from the given `imageProvider`.
899
899
///
900
900
/// Material Color Utilities extracts the dominant color from the
901
-
/// supplied [ImageProvider]. Using this color, a set of tonal palettes are
902
-
/// constructed. These tonal palettes are based on the Material 3 Color
903
-
/// system and provide all the needed colors for a [ColorScheme]. These
904
-
/// colors are designed to work well together and meet contrast
905
-
/// requirements for accessibility.
901
+
/// supplied [ImageProvider]. Using this color, a [ColorScheme] is generated
902
+
/// with harmnonious colors that meet contrast requirements for accessibility.
906
903
///
907
904
/// If any of the optional color parameters are non-null, they will be
908
905
/// used in place of the generated colors for that field in the resulting
909
-
/// color scheme. This allows apps to override specific colors for their
906
+
/// [ColorScheme]. This allows apps to override specific colors for their
910
907
/// needs.
911
908
///
912
909
/// Given the nature of the algorithm, the most dominant color of the
913
-
/// `imageProvider` may not wind up as one of the ColorScheme colors.
910
+
/// `imageProvider` may not wind up as one of the [ColorScheme] colors.
914
911
///
915
912
/// The provided image will be scaled down to a maximum size of 112x112 pixels
916
913
/// during color extraction.
917
914
///
915
+
/// {@tool dartpad}
916
+
/// This sample shows how to use [ColorScheme.fromImageProvider] to create
917
+
/// content-based dynamic color schemes.
918
+
///
919
+
/// ** See code in examples/api/lib/material/color_scheme/dynamic_content_color.0.dart **
920
+
/// {@end-tool}
921
+
///
918
922
/// See also:
919
923
///
924
+
/// * [M3 Guidelines: Dynamic color from content](https://m3.material.io/styles/color/dynamic-color/user-generated-color#8af550b9-a19e-4e9f-bb0a-7f611fed5d0f)
925
+
/// * <https://pub.dev/packages/dynamic_color>, a package to create
926
+
/// [ColorScheme]s based on a platform's implementation of dynamic color.
920
927
/// * <https://m3.material.io/styles/color/the-color-system/color-roles>, the
921
928
/// Material 3 Color system specification.
922
929
/// * <https://pub.dev/packages/material_color_utilities>, the package
923
-
/// used to generate the base color and tonal palettes needed for the scheme.
930
+
/// used to algorightmically determine the dominant color and to generate
0 commit comments