toLinear function

double toLinear(
  1. double c
)

sRGB to linear, per color.glsl.

Through portable_root.dart rather than math.pow: this runs on every pixel, and a libm that rounds its last bit differently turned a whole lit frame one step over on another platform.

Implementation

double toLinear(double c) =>
    c < 0.04045 ? c / 12.92 : portablePow12Over5((c + 0.055) / 1.055);