<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/blended(withFraction:of:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(im)blendedColorWithFraction:ofColor:"
  },
  "title" : "blended(withFraction:of:)"
}
-->

# blended(withFraction:of:)

Creates a new color object whose component values are a weighted sum of the current color object and the specified color object’s.

```
func blended(withFraction fraction: CGFloat, of color: NSColor) -> NSColor?
```

## Parameters

`fraction`

The amount of the color to blend with the receiver’s color. The method converts `color` and a copy of the receiver to RGB, and then sets each component of the returned color to `fraction` of `color`‘s value plus 1 – `fraction` of the receiver’s.

`color`

The color to blend with the receiver’s color.

## Return Value

The resulting color object or `nil` if the colors can’t be converted.

## Discussion

---

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)