blend

fun Blend.blend(from: Color, to: Color, amount: Float): Color

Blends two colors together, adjusting hue, chroma, and tone based on the specified amount.

This function computes a color that is a blend between the from color and the to color. The blending amount determines how much of the to color is mixed with the from color. An amount of 0.0 results in the original from color, while 1.0 results in the to color.

Return

The resulting Color that is blended from from towards to.

Parameters

from

The Color to blend from.

to

The Color to blend to.

amount

The proportion of blending; a value between 0.0 (fully from) and 1.0 (fully to).


fun Color.blend(to: Color, amount: Float = 0.5f): Color

Blends this Color into another color, adjusting hue, chroma, and tone based on the specified amount.

This extension function computes a color that is a blend between the receiver Color and the to color. The blending amount determines how much of the to color is mixed with the receiver color. An amount of 0.0 results in the receiver color, while 1.0 results in the to color.

Return

The resulting Color that is blended from the receiver color towards to.

Parameters

to

The Color to blend to.

amount

The proportion of blending; a value between 0.0 (fully receiver color) and 1.0 (fully to).