2021-01-07 18:06:09 +00:00
|
|
|
// Copyright 2018-2021 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-08-13 20:53:45 +00:00
|
|
|
import { ColorType } from '../types/Colors';
|
|
|
|
|
2021-01-07 18:06:09 +00:00
|
|
|
export function migrateColor(color?: string): ColorType {
|
2018-06-27 20:53:49 +00:00
|
|
|
switch (color) {
|
|
|
|
// These colors no longer exist
|
2018-09-26 00:26:06 +00:00
|
|
|
case 'orange':
|
|
|
|
case 'amber':
|
|
|
|
return 'deep_orange';
|
|
|
|
case 'yellow':
|
|
|
|
return 'brown';
|
2018-07-24 01:34:20 +00:00
|
|
|
case 'deep_purple':
|
|
|
|
return 'purple';
|
2018-06-27 20:53:49 +00:00
|
|
|
case 'light_blue':
|
|
|
|
return 'blue';
|
2018-09-26 00:26:06 +00:00
|
|
|
case 'cyan':
|
|
|
|
return 'teal';
|
2018-07-24 01:34:20 +00:00
|
|
|
case 'lime':
|
2018-09-26 00:26:06 +00:00
|
|
|
return 'light_green';
|
2018-06-27 20:53:49 +00:00
|
|
|
|
|
|
|
// These can stay as they are
|
2018-09-26 00:26:06 +00:00
|
|
|
case 'red':
|
2018-06-27 20:53:49 +00:00
|
|
|
case 'deep_orange':
|
2018-09-26 00:26:06 +00:00
|
|
|
case 'brown':
|
2018-06-27 20:53:49 +00:00
|
|
|
case 'pink':
|
|
|
|
case 'purple':
|
2018-09-26 00:26:06 +00:00
|
|
|
case 'indigo':
|
|
|
|
case 'blue':
|
2018-06-27 20:53:49 +00:00
|
|
|
case 'teal':
|
2018-09-26 00:26:06 +00:00
|
|
|
case 'green':
|
|
|
|
case 'light_green':
|
|
|
|
case 'blue_grey':
|
|
|
|
case 'grey':
|
2020-04-15 21:39:48 +00:00
|
|
|
case 'ultramarine':
|
2018-06-27 20:53:49 +00:00
|
|
|
return color;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return 'grey';
|
|
|
|
}
|
|
|
|
}
|