init(colorSpace:components:count:)
Creates a color object from the specified components of the given color space.
Declaration
init(colorSpace space: NSColorSpace, components: UnsafePointer<CGFloat>, count numberOfComponents: Int)Parameters
- space:
An
NSColorSpaceobject representing a color space. The colorspace should be component-based. The method raises if this isnilor a color space that cannot be used withNSColorobjects. - components:
An array of the components in the specified color space to use to create the
NSColorobject. The order of these components is determined by the color-space profile, with the alpha component always last. (If you want the created color to be opaque, specify 1.0 for the alpha component.) - numberOfComponents:
The number of components in the
componentsarray. This should match the number dictated by the specified color space plus one for alpha. This method raises an exception if they do not match.
Return Value
The color object.