Structure

TColor

Overview

TColor represents a color, using 4 stored properties - red, green, blue, and alpha. The expected value range for the color components is a floating point number in range 0.0 to 1.0. TColor provides a number of useful methods for working with a color.

Properties

var red: CGFloat

var green: CGFloat

var blue: CGFloat

var alpha: CGFloat

Computed properties

var hue: CGFloat

Computed based on the values of red, green, and blue. A value in range 0.0 to 360.0.

var saturation: CGFloat

Computed based on the values of red, green, and blue. A value in range 0.0 to 1.0.

var value: CGFloat

Computed based on the values of red, green, and blue. A value in range 0.0 to 1.0.

Initializers

init(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)

init(pixel: TPixel)

Methods

func brightness() -> CGFloat

Return the brightness of this color - which is computed as the average of the color components. (red, green, and blue)

func lightness() -> CGFloat

Return the lightness value of this color.

func luminance() -> CGFloat

Return the "relative luminance" of this color.

func setFillColor()

Set the renderer current fill color to the object color.

func setStrokeColor()

Set the renderer current stroke color to the object color.

Related

TImage

TPixel