Creates a copy of an existing color, substituting a new alpha value.
SDKs
- iOS 2.0+
- macOS 10.3+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
Parameters
color
The color to copy.
alpha
A value that specifies the desired opacity of the copy. Values outside the range
[0,1]
are clamped to0
or1
.
Return Value
A copy of the specified color, using the specified alpha value. You are responsible for releasing this object using CGColor
.