linearToSrgb function

double linearToSrgb(
  1. double c
)

One channel, linear to sRGB-encoded — IEC 61966-2-1's piecewise curve.

Implementation

double linearToSrgb(double c) => c <= 0.0031308
    ? c * 12.92
    : 1.055 * math.pow(c, 1.0 / 2.4).toDouble() - 0.055;