Contents

setFillPattern(_:colorComponents:)

Sets the fill pattern in the specified graphics context.

Declaration

func setFillPattern(_ pattern: CGPattern, colorComponents components: UnsafePointer<CGFloat>)

Parameters

  • pattern:

    A fill pattern. The object is retained; upon return, you may safely release it.

  • components:

    If the pattern is an uncolored (or a masking) pattern, pass an array of intensity values that specify the color to use when the pattern is painted. The number of array elements must equal the number of components in the base space of the fill pattern color space, plus an additional component for the alpha value.

    If the pattern is a colored pattern, pass an alpha value.

Discussion

The current fill color space must be a pattern color space. Otherwise, the result of calling this function is undefined. If you want to set a fill color, not a pattern, use setFillColor(_:).

See Also

Setting Path Drawing Options