API

Function GetWhiteBalanceMatrix

  • Computes the linear RGB (sRGB / Rec.709 primaries) color-correction matrix that white-balances the given illuminant, by chromatically adapting its white point (see TemperatureTintToXyz) to the working color space's reference white using the Bradford transform.

    Parameters

    • temperatureKelvin: number

      The correlated color temperature of the illuminant to neutralize, in Kelvin

    • tint: number

      An offset perpendicular to the Planckian locus (the green/magenta axis), in the range [-150, 150]

    Returns number[] | Float32Array<ArrayBufferLike>

    A column-major 3x3 matrix (9 values), ready to be bound as a mat3 shader uniform