Home Reference Source

src/utils/ColorUtils.js

import {CSSColors} from './ColorConstants';

/**
 * Function to convert CSS colors (first letter capitalized) to React colors (all lowercase)
 * @returns {string[]} All CSS colors with names understood by React
 */
function getColors() {
    const colors = [];
    let i = 0;
    CSSColors.forEach(
        color => colors.push({id: i++, name: color.toLowerCase()}), //Convert
    );
    return colors;
}

export {getColors};