---
title: "blended(withFraction:of:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolor/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.

## Declaration

```swift
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

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

## See Also

### Transforming existing color objects

- [usingColorSpace(_:)](appkit/nscolor/usingcolorspace(_:).md)
- [withAlphaComponent(_:)](appkit/nscolor/withalphacomponent(_:).md)
- [highlight(withLevel:)](appkit/nscolor/highlight(withlevel:).md)
- [shadow(withLevel:)](appkit/nscolor/shadow(withlevel:).md)
