mix

Returns a version of self mixed with rhs by the amount specified by fraction.

Color ModifieriOS 18.0+macOS 15.0+tvOS 18.0+watchOS 11.0+visionOS 2.0+mix(with:by:in:) in SwiftUI

Declaration

React
compose().mix({
  with: SwiftUI.Color,
  by: number,
  in?: SwiftUI.GradientColorSpace,
})
Swift
func mix(
    with rhs: Color,
    by fraction: Double,
    in colorSpace: Gradient.ColorSpace = .perceptual
) -> Color

Parameters

Return value

A new Color based on self and rhs.

See also

More in Color modifiers.