Contents

color(_:red:green:blue:opacity:)

Returns a shading instance that fills with a color in the given color space.

Declaration

static func color(_ colorSpace: Color.RGBColorSpace = .sRGB, red: Double, green: Double, blue: Double, opacity: Double = 1) -> GraphicsContext.Shading

Parameters

  • colorSpace:

    The RGB color space used to define the color. The default is Srgb.

  • red:

    The red component of the color.

  • green:

    The green component of the color.

  • blue:

    The blue component of the color.

  • opacity:

    The opacity of the color. The default is 1, which means fully opaque.

Return Value

A shading instance filled with a color.

See Also

Colors