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
@spec from_rgb(Ultraviolet.Color.t(), list()) :: number()
Converts a color into an approximate temperature.
@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.