Ensure that color mapping matches the spreadsheet

This commit is contained in:
Scott Nonnenberg 2018-07-23 18:34:20 -07:00
parent 8f6f24e958
commit 3a07e9ae73

View file

@ -4,19 +4,22 @@ type OldColor =
| 'amber'
| 'blue'
| 'blue_grey'
| 'brown'
| 'cyan'
| 'deep_orange'
| 'deep_purple'
| 'green'
| 'grey'
| 'indigo'
| 'lime'
| 'light_blue'
| 'light_green'
| 'orange'
| 'pink'
| 'purple'
| 'red'
| 'teal';
| 'teal'
| 'yellow';
type NewColor =
| 'blue'
@ -33,19 +36,26 @@ type NewColor =
export function migrateColor(color: OldColor): NewColor {
switch (color) {
// These colors no longer exist
case 'amber':
case 'orange':
case 'brown':
return 'red';
case 'blue_grey':
case 'light_blue':
return 'blue';
case 'deep_purple':
return 'purple';
case 'light_blue':
return 'blue';
case 'blue_grey':
return 'cyan';
case 'light_green':
return 'teal';
case 'lime':
return 'green';
case 'orange':
case 'amber':
case 'yellow':
return 'deep_orange';
// These can stay as they are
case 'blue':