Unverified Commit 252491f8 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Updated ColorScheme.dark() colors to match the Material Dark theme specification (#36106)

Updated ColorScheme.dark() primaryVariant, surface, background and error
colors to match the spec.
parent 09002457
...@@ -76,16 +76,16 @@ class ColorScheme extends Diagnosticable { ...@@ -76,16 +76,16 @@ class ColorScheme extends Diagnosticable {
assert(onError != null), assert(onError != null),
assert(brightness != null); assert(brightness != null);
/// Create dark version of the /// Create the recommended dark color scheme that matches the
/// [baseline Material color scheme](https://material.io/design/color/the-color-system.html#color-theme-creation). /// [baseline Material color scheme](https://material.io/design/color/dark-theme.html#ui-application).
const ColorScheme.dark({ const ColorScheme.dark({
this.primary = const Color(0xffbb86fc), this.primary = const Color(0xffbb86fc),
this.primaryVariant = const Color(0xff4b01d0), this.primaryVariant = const Color(0xff3700B3),
this.secondary = const Color(0xff03dac6), this.secondary = const Color(0xff03dac6),
this.secondaryVariant = const Color(0xff03dac6), this.secondaryVariant = const Color(0xff03dac6),
this.surface = Colors.black, this.surface = const Color(0xff121212),
this.background = Colors.black, this.background = const Color(0xff121212),
this.error = const Color(0xffb00020), this.error = const Color(0xffcf6679),
this.onPrimary = Colors.black, this.onPrimary = Colors.black,
this.onSecondary = Colors.black, this.onSecondary = Colors.black,
this.onSurface = Colors.white, this.onSurface = Colors.white,
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
test('light scheme matches the spec', () {
// Colors should match the The Material Design baseline default theme:
// https://material.io/design/color/dark-theme.html#ui-application
const ColorScheme scheme = ColorScheme.light();
expect(scheme.primary, const Color(0xff6200ee));
expect(scheme.primaryVariant, const Color(0xff3700b3));
expect(scheme.secondary, const Color(0xff03dac6));
expect(scheme.secondaryVariant, const Color(0xff018786));
expect(scheme.background, const Color(0xffffffff));
expect(scheme.surface, const Color(0xffffffff));
expect(scheme.error, const Color(0xffb00020));
expect(scheme.onPrimary, const Color(0xffffffff));
expect(scheme.onSecondary, const Color(0xff000000));
expect(scheme.onBackground, const Color(0xff000000));
expect(scheme.onSurface, const Color(0xff000000));
expect(scheme.onError, const Color(0xffffffff));
expect(scheme.brightness, Brightness.light);
});
test('dark scheme matches the spec', () {
// Colors should match the The Material Design baseline dark theme:
// https://material.io/design/color/dark-theme.html#ui-application
const ColorScheme scheme = ColorScheme.dark();
expect(scheme.primary, const Color(0xffbb86fc));
expect(scheme.primaryVariant, const Color(0xff3700b3));
expect(scheme.secondary, const Color(0xff03dac6));
expect(scheme.secondaryVariant, const Color(0xff03dac6));
expect(scheme.background, const Color(0xff121212));
expect(scheme.surface, const Color(0xff121212));
expect(scheme.error, const Color(0xffcf6679));
expect(scheme.onPrimary, const Color(0xff000000));
expect(scheme.onSecondary, const Color(0xff000000));
expect(scheme.onBackground, const Color(0xffffffff));
expect(scheme.onSurface, const Color(0xffffffff));
expect(scheme.onError, const Color(0xff000000));
expect(scheme.brightness, Brightness.dark);
});
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment