Contents

setFillColor(gray:alpha:)

Sets the current fill color to a value in the DeviceGray color space.

Declaration

func setFillColor(gray: CGFloat, alpha: CGFloat)

Parameters

  • gray:

    A value that specifies the desired gray level. The DeviceGray color space permits the specification of a value ranging from 0.0 (absolute black) to 1.0 (absolute white). Values outside this range are clamped to 0.0 or 1.0.

  • alpha:

    A value that specifies the opacity level. Values can range from 0.0 (transparent) to 1.0 (opaque). Values outside this range are clipped to 0.0 or 1.0.

Discussion

When you call this function, two things happen:

  • Core Graphics sets the current fill color space to DeviceGray.

  • Core Graphics sets the current fill color to the value you specify in the gray and alpha parameters.

See Also

Setting Fill, Stroke, and Shadow Colors