<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setBlendColor(red:green:blue:alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)setBlendColorRed:green:blue:alpha:"
  },
  "title" : "setBlendColor(red:green:blue:alpha:)"
}
-->

# setBlendColor(red:green:blue:alpha:)

Configures each pixel component value, including alpha, for the render pipeline’s constant blend color.

```
func setBlendColor(red: Float, green: Float, blue: Float, alpha: Float)
```

## Parameters

`red`

A value for the red component for the blend color constant.

`green`

A value for the green component for the blend color constant.

`blue`

A value for the blue component for the blend color constant.

`alpha`

A value for the alpha component for the blend color constant.

## Discussion

The alpha and color values apply to all the render pass’s attachments. The `red`, `green`, and `blue` color parameters apply to the [`MTLBlendFactor.blendColor`](/documentation/Metal/MTLBlendFactor/blendColor) and [`MTLBlendFactor.oneMinusBlendColor`](/documentation/Metal/MTLBlendFactor/oneMinusBlendColor) blend factors.

The `alpha` parameter applies to the [`MTLBlendFactor.blendAlpha`](/documentation/Metal/MTLBlendFactor/blendAlpha) and [`MTLBlendFactor.oneMinusBlendAlpha`](/documentation/Metal/MTLBlendFactor/oneMinusBlendAlpha) blend factors.

The render pipeline’s default blend color value is `0.0` for each parameter, which is equivalent to [`MTLBlendFactor.zero`](/documentation/Metal/MTLBlendFactor/zero). For other blending factor values, see [`MTLBlendFactor`](/documentation/Metal/MTLBlendFactor).

---

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)