hyper/lib/utils/colors.js
David Gómez 8f28573fc0 Prefer default export to make XO happy (#931)
* Comply with prefer-default-export rule for findBySession function

* Remove XO's prefer-default-export rule

* Comply with prefer-default-export rule for init function

* Comply with prefer-default-export rule for getRootGroups function

* Comply with prefer-default-export rule for INIT constant

* Comply with prefer-default-export rule for isExecutable function

* Fix default export for constants

* Comply with prefer-default-export rule for last function

* Comply with prefer-default-export rule for getColorList function
2016-10-25 14:53:15 +02:00

31 lines
518 B
JavaScript

const colorList = [
'black',
'red',
'green',
'yellow',
'blue',
'magenta',
'cyan',
'white',
'lightBlack',
'lightRed',
'lightGreen',
'lightYellow',
'lightBlue',
'lightMagenta',
'lightCyan',
'lightWhite',
'colorCubes',
'grayscale'
];
export default function getColorList(colors) {
// For backwards compatibility, return early if it's already an array
if (Array.isArray(colors)) {
return colors;
}
return colorList.map(colorName => {
return colors[colorName];
});
}