Instance Method

setColorByTemperature(_:)

Sets the light’s color based on a black-body temperature.

Declaration

func setColorByTemperature(_ temperature: Float)

Parameters

temperature

The black-body temperature, in Kelvins, whose luminous color the light should match.

Discussion

Real-world light sources often measure color of illumination based on a black-body temperature scale. For example, the colors and characterizations of typical home and office light fixtures correspond to the following temperatures:

Label

Color

Temperature

“Soft white”

Warm, yellowish white

2700 K

“Bright white”

Pale yellowish white

3000 K

“Daylight”

Bright, slightly greenish white

5000 K

“Cool daylight”

Bright, slightly bluish white

6500 K

See Also

Managing Light Color and Intensity

var color: CGColor?

The color of the light source.

var lumens: Float

The total visible intensity of the light source, in lumens.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software