CGColor

public extension CGColor
  • Creates a white color in the RGB color space.

    Declaration

    Swift

    static func white(_ white: CGFloat = 1.0, alpha: CGFloat = 1.0) -> CGColor?

    Parameters

    white

    how bright the color is, on a scale from 0 through 1.

    alpha

    transparency, on a scale from 0 through 1.

    Return Value

    the specified white color.

  • Creates a black color in the RGB color space.

    Declaration

    Swift

    static func black(_ black: CGFloat = 1.0, alpha: CGFloat = 1.0) -> CGColor?

    Parameters

    black

    how dark the color is, on a scale from 0 through 1.

    alpha

    transparency, on a scale from 0 through 1.

    Return Value

    white(1 - black, alpha: alpha).