View Source Ultraviolet.Color.Temperature (Ultraviolet v0.1.1)

Functions for mapping temperatures to colors.

Based on Neil Bartlett's implementation

See Ultraviolet.temperature/1 for examples.

Summary

Functions

Converts a color into an approximate temperature.

Converts a temperature to an approximate color.

Functions

Link to this function

from_rgb(color, options \\ [])

View Source
@spec from_rgb(Ultraviolet.Color.t(), list()) :: number()

Converts a color into an approximate temperature.

Link to this function

to_rgb(kelvin, options \\ [])

View Source
@spec to_rgb(number(), list()) :: {:ok, Ultraviolet.Color.t()} | {:error, term()}

Converts a temperature to an approximate color.

The effective temperature range goes from 0 to about 30,000K.