constructor(...args) {
    if (Array.isArray(args[0])) {
      const [coords, space] = args;

      if (space === "lab") {
        this._lab = coords;
      } else {
        this._rgb = coords;
      }
    } else if (typeof args[0] === "string") {
      const str = args[0];

      if (str[0] === "#" && str.length === 7) {
        this._hex = str;
        this._rgb = Color.parseHex(str);
      } else if (str.startsWith("rgb(")) {
        this._rgb = Color.parseRGB(str);
      } else if (str.startsWith("rgba(")) {
        [this._rgb, this._alpha] = Color.parseRGBA(str);
      } else {
        throw new Error(`Unsupported color format: "${str}"`);
      }
    } else {
      this._rgb = [0, 0, 0];
    }
  }
Interface for storing and processing sRGB colors in CIELAB
Adapted from => https://github.com/LeaVerou/color.js