Skip to content

Commit f4f9ff6

Browse files
Material Engcopybara-github
authored andcommitted
Add label and description to Variants
PiperOrigin-RevId: 527905849
1 parent e729b2d commit f4f9ff6

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

dart/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.0 - 2023-04-28
2+
### Added
3+
- Add `label` and `description` to each `Variant`
4+
15
## 0.3.0 - 2023-03-10
26
### Added
37

dart/lib/scheme/variant.dart

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,21 @@
1616
/// Instantiate the corresponding subclass, ex. SchemeTonalSpot, to create
1717
/// colors corresponding to the theme.
1818
enum Variant {
19-
monochrome,
20-
neutral,
21-
tonalSpot,
22-
vibrant,
23-
expressive,
24-
fidelity,
25-
content;
19+
monochrome('monochrome', 'All colors are grayscale, no chroma.'),
20+
neutral('neutral', 'Close to grayscale, a hint of chroma.'),
21+
tonalSpot('tonal spot',
22+
'Pastel tokens, low chroma palettes (32).\nDefault Material You theme at 2021 launch.'),
23+
vibrant('vibrant',
24+
'Pastel colors, high chroma palettes. (max).\nThe primary palette\'s chroma is at maximum.\nUse Fidelity instead if tokens should alter their tone to match the palette vibrancy.'),
25+
expressive('expressive',
26+
'Pastel colors, medium chroma palettes.\nThe primary palette\'s hue is different from source color, for variety.'),
27+
content('content',
28+
'Almost identical to Fidelity.\nTokens and palettes match source color.\nPrimary Container is source color, adjusted to ensure contrast with surfaces.\n\nTertiary palette is analogue of source color.\nFound by dividing color wheel by 6, then finding the 2 colors adjacent to source.\nThe one that increases hue is used.'),
29+
fidelity('fidelity',
30+
'Tokens and palettes match source color.\nPrimary Container is source color, adjusted to ensure contrast with surfaces.\nFor example, if source color is black, it is lightened so it doesn\'t match surfaces in dark mode.\n\nTertiary palette is complement of source color.');
31+
32+
final String label;
33+
final String description;
34+
35+
const Variant(this.label, this.description);
2636
}

0 commit comments

Comments
 (0)