1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
use super::rgb::*;
use super::kelvin::*;
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct Celsius(pub f32);
impl From<Celsius> for Kelvin
{
fn from(c:Celsius) -> Self
{
Kelvin(c.0 + 273.15)
}
}
impl From<Kelvin> for Celsius
{
fn from(k:Kelvin) -> Self
{
Celsius(k.0 - 273.15)
}
}
impl From<Celsius> for RGBSpectrum
{
fn from(c:Celsius) -> Self
{
let k : Kelvin = c.into();
return k.into();
}
}