2016-07-21 11:24:00 -08:00
|
|
|
const colorList = [
|
|
|
|
|
'black',
|
|
|
|
|
'red',
|
|
|
|
|
'green',
|
|
|
|
|
'yellow',
|
|
|
|
|
'blue',
|
|
|
|
|
'magenta',
|
|
|
|
|
'cyan',
|
|
|
|
|
'white',
|
|
|
|
|
'lightBlack',
|
|
|
|
|
'lightRed',
|
|
|
|
|
'lightGreen',
|
|
|
|
|
'lightYellow',
|
|
|
|
|
'lightBlue',
|
|
|
|
|
'lightMagenta',
|
|
|
|
|
'lightCyan',
|
|
|
|
|
'lightWhite',
|
|
|
|
|
'colorCubes',
|
|
|
|
|
'grayscale'
|
2016-07-21 19:26:10 -08:00
|
|
|
];
|
2016-07-21 11:24:00 -08:00
|
|
|
|
2016-10-25 04:53:15 -08:00
|
|
|
export default function getColorList(colors) {
|
2016-07-21 11:24:00 -08:00
|
|
|
// For backwards compatibility, return early if it's already an array
|
|
|
|
|
if (Array.isArray(colors)) {
|
|
|
|
|
return colors;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
return colorList.map(colorName => {
|
2016-07-21 19:26:10 -08:00
|
|
|
return colors[colorName];
|
|
|
|
|
});
|
2016-07-21 11:24:00 -08:00
|
|
|
}
|