Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1071)

Side by Side Diff: sky/sdk/lib/theme/theme_data.dart

Issue 1232313002: Use package:sky imports consistently (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix BUILD.gn Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/theme/shadows.dart ('k') | sky/sdk/lib/theme/typography.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:sky'; 5 import 'dart:sky';
6 6
7 import 'typography.dart' as typography; 7 import 'package:sky/theme/typography.dart' as typography;
8 import 'colors.dart' as colors; 8 import 'package:sky/theme/colors.dart' as colors;
9 9
10 enum ThemeBrightness { dark, light } 10 enum ThemeBrightness { dark, light }
11 11
12 class ThemeData { 12 class ThemeData {
13 13
14 ThemeData({ 14 ThemeData({
15 ThemeBrightness brightness, 15 ThemeBrightness brightness,
16 Map<int, Color> primarySwatch, 16 Map<int, Color> primarySwatch,
17 Color accentColor, 17 Color accentColor,
18 this.accentColorBrightness: ThemeBrightness.dark, 18 this.accentColorBrightness: ThemeBrightness.dark,
19 typography.TextTheme text }) 19 typography.TextTheme text })
20 : this.brightness = brightness, 20 : this.brightness = brightness,
21 this.primarySwatch = primarySwatch, 21 this.primarySwatch = primarySwatch,
22 primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightn ess.dark, 22 primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightn ess.dark,
23 canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colo rs.Grey[50], 23 canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colo rs.Grey[50],
24 cardColor = brightness == ThemeBrightness.dark ? colors.Grey[800] : colors .White, 24 cardColor = brightness == ThemeBrightness.dark ? colors.Grey[800] : colors .White,
25 dividerColor = brightness == ThemeBrightness.dark ? const Color(0x1FFFFFFF ) : const Color(0x1F000000), 25 dividerColor = brightness == ThemeBrightness.dark ? const Color(0x1FFFFFFF ) : const Color(0x1F000000),
26 text = brightness == ThemeBrightness.dark ? typography.white : typography. black { 26 text = brightness == ThemeBrightness.dark ? typography.white : typography. black {
27 assert(brightness != null); 27 assert(brightness != null);
28 28
29 if (primarySwatch == null) { 29 if (primarySwatch == null) {
30 if (brightness == ThemeBrightness.dark) { 30 if (brightness == ThemeBrightness.dark) {
31 _primaryColor = colors.Grey[900]; 31 _primaryColor = colors.Grey[900];
32 } else { 32 } else {
33 _primaryColor = colors.Grey[100]; 33 _primaryColor = colors.Grey[100];
34 } 34 }
35 } else { 35 } else {
36 _primaryColor = primarySwatch[500]; 36 _primaryColor = primarySwatch[500];
37 } 37 }
38 38
39 if (accentColor == null) { 39 if (accentColor == null) {
40 _accentColor = primarySwatch == null ? colors.Blue[500] : primarySwatch[50 0]; 40 _accentColor = primarySwatch == null ? colors.Blue[500] : primarySwatch[50 0];
41 } else { 41 } else {
42 _accentColor = accentColor; 42 _accentColor = accentColor;
43 } 43 }
44 } 44 }
45 45
46 factory ThemeData.light() => new ThemeData(primarySwatch: colors.Blue, brightn ess: ThemeBrightness.light); 46 factory ThemeData.light() => new ThemeData(primarySwatch: colors.Blue, brightn ess: ThemeBrightness.light);
47 factory ThemeData.dark() => new ThemeData(brightness: ThemeBrightness.dark); 47 factory ThemeData.dark() => new ThemeData(brightness: ThemeBrightness.dark);
48 factory ThemeData.fallback() => new ThemeData.light(); 48 factory ThemeData.fallback() => new ThemeData.light();
49 49
50 final ThemeBrightness brightness; 50 final ThemeBrightness brightness;
51 final Map<int, Color> primarySwatch; 51 final Map<int, Color> primarySwatch;
52 final Color canvasColor; 52 final Color canvasColor;
53 final Color cardColor; 53 final Color cardColor;
54 final Color dividerColor; 54 final Color dividerColor;
55 final typography.TextTheme text; 55 final typography.TextTheme text;
56 56
57 Color _primaryColor; 57 Color _primaryColor;
58 Color get primaryColor => _primaryColor; 58 Color get primaryColor => _primaryColor;
59 59
60 final ThemeBrightness primaryColorBrightness; 60 final ThemeBrightness primaryColorBrightness;
61 61
62 Color _accentColor; 62 Color _accentColor;
63 Color get accentColor => _accentColor; 63 Color get accentColor => _accentColor;
64 64
65 final ThemeBrightness accentColorBrightness; 65 final ThemeBrightness accentColorBrightness;
66 } 66 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/theme/shadows.dart ('k') | sky/sdk/lib/theme/typography.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698