---
title: "setColorByTemperature(_:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlphysicallyplausiblelight/setcolorbytemperature(_:)"
---

# setColorByTemperature(_:)

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

## Declaration

```swift
func setColorByTemperature(_ temperature: Float)
```

## Parameters

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

## Discussion

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:  |  |   |  |   |  |   |  |   |  |

## See Also

### Managing Light Color and Intensity

- [color](modelio/mdlphysicallyplausiblelight/color.md)
- [lumens](modelio/mdlphysicallyplausiblelight/lumens.md)
