getColorName = (object) => {
  let colorName
  if (object.color) {
    const r = object.color[0]
    const g = object.color[1]
    const b = object.color[2]
    // find the closest css color
    let closest = 255 + 255 + 255
    for (const name in colors.cssColors) {
      const rgb = colors.cssColors[name]
      const diff = Math.abs(r - rgb[0]) + Math.abs(g - rgb[1]) + Math.abs(b - rgb[2])
      if (diff < closest) {
        colorName = name
        if (diff === 0) break
        closest = diff
      }
    }
  }
  return colorName
}
Get the closest css color name