withAlphaComponent(_:)
Creates a new color object that has the same color space and component values as the current color object, but the specified alpha component.
Declaration
func withAlphaComponent(_ alpha: CGFloat) -> NSColorParameters
- alpha:
The opacity value of the new
NSColorobject.
Return Value
The new NSColor object. If the receiver’s color space doesn’t include an alpha component, the receiver is returned.
Discussion
A subclass with explicit opacity components should override this method to return a color with the specified alpha.