Contents

init(colorSpace:hue:saturation:brightness:alpha:)

Creates a color object with the specified color space, hue, saturation, brightness, and alpha channel values.

Declaration

init(colorSpace space: NSColorSpace, hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat)

Parameters

  • space:

    An NSColorSpace object representing a color space. An exception is raised if the color model of the provided color space is not RGB.

  • hue:

    The hue (color) component, expressed as a floating-point value in the range 0–1.0.

  • saturation:

    The color saturation component, expressed as a floating-point value in the range 0–1.0.

  • brightness:

    The brightness component, expressed as a floating-point value in the range 0–1.0.

  • alpha:

    The alpha (opacity), expressed as a floating-point value in the range 0 (transparent) to 1.0 (opaque).

Return Value

The color object.

See Also

Creating a color using HSB components