Color ratioπ
Given a reference color and a color sample, calculates scaling factors suitable for color balancing. For accurate results, linear colors should be used as input. See gamma correction for details.
Inputsπ
referenceColor
: The reference color.color
: A color sample. If a channel in the color is zero, the corresponding scaling factor will be set to one.normalize
: Iftrue
, the input colors are normalized to equal intensity (luminance) before calculating the scaling factors. This way, the calculated scaling factors wonβt change average intensity. If this flag isfalse
, the scaling factors are calculated from non-normalized input colors.
Outputsπ
scalingFactors
: Scaling factors for each color channel represented as a 1-by-3 matrix. The order is red, green, blue.