code: function Palette(buf) {
    if (!(this instanceof Palette)) return new Palette(buf)
  
    if (!buf) buf = []
  
    let data
    // creating a new palette
    if (Array.isArray(buf)) {
      data = { colors: buf, numColors: buf.length, version: '0100' }
    }
    // reading a palette
    else {
      let str = Buffer.isBuffer(buf) ? buf.toString('ascii') : buf
      data = parse(str)
    }
  
    // internal API
    assign(this, data)
    // public API
    data.colors.version = data.version
    Object.keys(Palette.prototype)
      .forEach(key => data.colors[key] = this[key].bind(this))
  
    return data.colors
  }
docs: A JASC Paint Shop Pro Palette file.  Usage: Palette(buf) where `buf` is a palette file source string or Buffer let pal = Palette(fs.readFileSync('palette.pal')) → a palette array parsed from source let pal = Palette([ [ r0, g0, b0 ], [ r1, g1, b1 ] ]) → a new palette array pal[0], pal.getColor(0) → the colour at the given index pal[0] = [ r, g, b ], pal.setColor(0, [ r, g, b ]) → set colour at an index pal.toString() → new palette file source string  Palette file format: ``` "JASC-PAL" 4 character version amount of lines palette lines: three space-separated numbers (0-255), "<red> <green> <blue>" ```