code: function rgbToObject(rgb) {
    const isRgba = rgb.toLowerCase().indexOf('rgba') === 0;
    const color = rgb.replace(/ /g, '');
    const result = isRgba ? RGBA_REGEX.exec(color) : RGB_REGEX.exec(color);
  
    // Safety check, if color is in the wrong format
    if (!result) {
      console.warn(`Plx, ERROR: rgb or rgba color is not in the right format: "${ rgb }"`); // eslint-disable-line
      return null;
    }
  
    // All color functions are returning { r, g, b, a } object
    return {
      r: parseInt(result[1], 10),
      g: parseInt(result[2], 10),
      b: parseInt(result[3], 10),
      a: isRgba ? parseFloat(result[4]) : 1,
    };
  }
docs: Convers color in rgb format into object { r, g, b, a }