mixSpectral

fun mixSpectral(color1: ColorRGBa, color2: ColorRGBa, t: Double, k1: Double = 0.0, k2: Double = 0.0): ColorRGBa(source)

Blends two colors spectrally by interpolating their reflectance spectra and returns the resulting color. This method uses spectral upsampling, Saunderson correction, and concentration factors to compute the resulting color in the RGB color space.

Return

The resulting blended color as a ColorRGBa, maintaining the linearity of the first input color (color1).

Parameters

color1

The first color to be mixed, represented as a ColorRGBa.

color2

The second color to be mixed, represented as a ColorRGBa.

t

The blending factor in the range 0.0, 1.0, where 0.0 represents full influence of color1 and 1.0 represents full influence of color2.

k1

The first Saunderson correction coefficient for surface reflection. Default is 0.0.

k2

The second Saunderson correction coefficient for internal reflections. Default is 0.0.