<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Color/mix(with:by:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ColorV3mix4with2by2inA2C_SdAA8GradientV0C5SpaceVtF"
  },
  "title" : "mix(with:by:in:)"
}
-->

# mix(with:by:in:)

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

```
func mix(with rhs: Color, by fraction: Double, in colorSpace: Gradient.ColorSpace = .perceptual) -> Color
```

## Parameters

`rhs`

The color to mix `self` with.

`fraction`

The amount of blending, `0.5` means `self` is mixed in
equal parts with `rhs`.

`colorSpace`

The color space used to mix the colors.

## Return Value

A new `Color` based on `self` and `rhs`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)