mix

fun <T : Color> ColorSpace<T>.mix(color1: Color, color2: Color, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color
fun <T : Color> ColorSpace<T>.mix(color1: Color, amount1: Number, color2: Color, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color
fun <T : Color> ColorSpace<T>.mix(color1: Color, color2: Color, amount2: Number, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color


fun <T : Color> ColorSpace<T>.mix(color1: Color, amount1: Number, color2: Color, amount2: Number, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color

Mix amount1 of color1 and amount2 of color2 in this color space.

The sum of the amounts is greater than one, they will be normalized so the sum equals one. If the sum is less than one, they will be normalized and the final alpha value will be multiplied by their sum.

This implements the color-mix functionality specified in CSS Color Module 5

Parameters

amount1

The amount of color1 to mix. A fraction in [0, 1]. If omitted, defaults to 1 - amount2

amount2

The amount of color2 to mix. A fraction in [0, 1]. If omitted, defaults to 1 - amount1

hueAdjustment

An optional adjustment to the hue components of the colors, if there is one. Defaults to HueAdjustments.shorter.