gammaToLinear method Null safety

void gammaToLinear(
  1. Vector4 gammaColor,
  2. Vector4 linearColor,
  3. [double gamma = 2.2]
)

Convert gammaColor from gamma space into linear color space and store the result in linearColor. It is possible to specify a optional gamma, the default value is 2.2.

Implementation

static void gammaToLinear(Vector4 gammaColor, Vector4 linearColor,
    [double gamma = 2.2]) {
  linearColor
    ..r = math.pow(gammaColor.r, gamma).toDouble()
    ..g = math.pow(gammaColor.g, gamma).toDouble()
    ..b = math.pow(gammaColor.b, gamma).toDouble()
    ..a = gammaColor.a;
}