code: function lin_sRGB(RGB) {
    // convert an array of sRGB values in the range 0.0 - 1.0
    // to linear light (un-companded) form.
    // https://en.wikipedia.org/wiki/SRGB
    return RGB.map(function(val) {
      if (val < 0.04045) {
        return val / 12.92;
      }
  
      return Math.pow((val + 0.055) / 1.055, 2.4);
    });
  }
docs: these algorithms are sourced from https://drafts.csswg.org/css-color/#color-conversion-code