Global Function

fillColor()

Declaration

func fillColor(red: Double, green: Double, blue: Double, alpha: Double)
func fillColor(gray: Double, alpha: Double)
func fillColor(gray: Double)
func fillColor(color: NSColor)
func fillColor() -> NSColor

Parameters

gray A grayscale value (Double) in the range 0.0 to 1.0.
red, green, blue red, green, blue color components to define the fill color in the range 0.0 to 1.0.
alpha A value (Double) in the range 0.0 to 1.0 to define opacity. 1.0 is completely opaque. 0.0 is completely transparent.
color NSColor object to define the fill color.

Returns

-

Description

Sets the color used to fill shapes. Drawing operations that happen after this function (for example, calling rect or ellipse) will use this color to fill the shape.

Examples

// Fill to full red
fillColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0)

// Fill to white with 50% transparency
fillColor(gray: 1.0, alpha: 0.5)

// Fill to white
fillColor(gray: 1.0)

Related

fillDisable()
strokeColor()
strokeDisable()
background()