static getColorName_(string) {
    let colorString = string.toLowerCase();
    const rgb = colorString.replace(/\s/g, '')
        .match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);
    if (rgb) {
      colorString = '#' +
          (parseInt(rgb[1], 10) | (1 << 8)).toString(16).slice(1) +
          (parseInt(rgb[2], 10) | (1 << 8)).toString(16).slice(1) +
          (parseInt(rgb[3], 10) | (1 << 8)).toString(16).slice(1);
    } else if (colorString.startsWith('#') && colorString.length > 7) {
      // With this we lose the alpha of the color, but it is better than having
      // no color.
      colorString = colorString.slice(0, 7);
    }
    switch (colorString) {
      case 'white':
      case '#fff':
      case '#ffffff':
        return 'white';
      case 'lime':
      case '#0f0':
      case '#00ff00':
        return 'lime';
      case 'cyan':
      case '#0ff':
      case '#00ffff':
        return 'cyan';
      case 'red':
      case '#f00':
      case '#ff0000':
        return 'red';
      case 'yellow':
      case '#ff0':
      case '#ffff00':
        return 'yellow';
      case 'magenta':
      case '#f0f':
      case '#ff00ff':
        return 'magenta';
      case 'blue':
      case '#00f':
      case '#0000ff':
        return 'blue';
      case 'black':
      case '#000':
      case '#000000':
        return 'black';
    }
    // No color name
    return null;
  }
Gets the color name from a color string.

@param {string} string
@return {?string}
@private