function replaceRgbaWithHex (s) {
  return s.replace(rgbaRegex, (matchedString, r, g, b, _a) => {
    const r1 = parseInt(r, 10)
    const g1 = parseInt(g, 10)
    const b1 = parseInt(b, 10)
    for (const hexColor of Object.values(colorBuckets)) {
      const [r2, g2, b2] = hexToRgb(hexColor)
      if ([[r1, r2], [g1, g2], [b1, b2]].every(([v1, v2]) => isSimilar(v1, v2))) {
        console.log(`replacing ${matchedString} with normalized value: ${hexColor}`)
        return `${hexColor}`
      }
    }
    return matchedString
  })
}
Replaces rgba values with the bucketed hex value.
Tries to detect if the value is similar to one of the bucket values.
If so, will round into a bucket value.
@param s text contents of the file