forked from firka/flutter
Introduce tone-based surfaces and accent color add-ons - Part 2 (#138521)
This PR is to introduce 19 new color roles and deprecate 3 color roles in `ColorScheme`. **Tone-based surface colors** (7 colors): * surfaceBright * surfaceDim * surfaceContainer * surfaceContainerLowest * surfaceContainerLow * surfaceContainerHigh * surfaceContainerHighest **Accent color add-ons** (12 colors): * primary/secondary/tertiary-Fixed * primary/secondary/tertiary-FixedDim * onPrimary/onSecondary/onTertiary-Fixed * onPrimary/onSecondary/onTertiary-FixedVariant **Deprecated colors**: * background -> replaced with surface * onBackground -> replaced with onSurface * surfaceVariant -> replaced with surfaceContainerHighest Please checkout this [design doc](https://docs.google.com/document/d/1ODqivpM_6c490T4j5XIiWCDKo5YqHy78YEFqDm4S8h4/edit?usp=sharing) for more information:) 
This commit is contained in:
@@ -202,7 +202,7 @@ class KeyPad extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: Material(
|
||||
color: themeData.colorScheme.background,
|
||||
color: themeData.colorScheme.surface,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
CalcKey('\u232B', calcState!.handleDelTap),
|
||||
|
||||
@@ -203,7 +203,7 @@ class _ChipDemoState extends State<ChipDemo> {
|
||||
assert(name.length > 1);
|
||||
final int hash = name.hashCode & 0xffff;
|
||||
final double hue = (360.0 * hash / (1 << 15)) % 360.0;
|
||||
final double themeValue = HSVColor.fromColor(theme.colorScheme.background).value;
|
||||
final double themeValue = HSVColor.fromColor(theme.colorScheme.surface).value;
|
||||
return HSVColor.fromAHSV(1.0, hue, 0.4, themeValue).toColor();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,12 +114,10 @@ const ColorScheme kShrineColorScheme = ColorScheme(
|
||||
primary: kShrinePink100,
|
||||
secondary: kShrinePink50,
|
||||
surface: kShrineSurfaceWhite,
|
||||
background: kShrineBackgroundWhite,
|
||||
error: kShrineErrorRed,
|
||||
onPrimary: kShrineBrown900,
|
||||
onSecondary: kShrineBrown900,
|
||||
onSurface: kShrineBrown900,
|
||||
onBackground: kShrineBrown900,
|
||||
onError: kShrineSurfaceWhite,
|
||||
brightness: Brightness.light,
|
||||
);
|
||||
|
||||
@@ -23,7 +23,7 @@ ThemeData _buildDarkTheme() {
|
||||
secondary: secondaryColor,
|
||||
onPrimary: Colors.white,
|
||||
error: const Color(0xFFB00020),
|
||||
background: const Color(0xFF202124),
|
||||
surface: const Color(0xFF202124),
|
||||
);
|
||||
final ThemeData base = ThemeData(
|
||||
useMaterial3: false,
|
||||
|
||||
Reference in New Issue
Block a user