function standardizeColor(name) {

    // Since invalid color's will be parsed as black, filter them out
    if (name.toLowerCase() === 'black') {
        return '#000';
    }

    const ctx = document.createElement('canvas').getContext('2d');
    ctx.fillStyle = name;
    return ctx.fillStyle === '#000' ? null : ctx.fillStyle;
}
Tries to convert a color name to rgb/a hex representation
@param name
@returns {string | CanvasGradient | CanvasPattern}