//You can install the color library in your project using npm:
//npm install color --save
//Call it like
/*
standardizeColorFormat({ color: 'rgb(255, 0, 0)' });
// returns 'rgb(255, 0, 0)'

standardizeColorFormat({ color: 'rgba(255, 0, 0, 0.5)' });
// returns 'rgba(255, 0, 0, 0.5)'

standardizeColorFormat({ color: 'blue' });
// returns 'rgb(0, 0, 255)'

standardizeColorFormat({ color: '#00ff00' });
// returns 'rgb(0, 255, 0)'
*/


function colorHelper(obj) {
    // Import the color module, which will be used to convert colors.
    // You can add this to your project using npm install color --save if you are using npm
    var colorModule = require('color');

    const { color, returnHex } = obj;

    // Convert the color into a standardized format using the color module.
    let standardizedColor = colorModule(color);

    // Check if the user has requested the hex format.
    if (returnHex === 'true') {
        return standardizedColor.hex();
    }

    return standardizedColor.rgb().string();
}
