From 5430ee0d7e579e1ded7dbb7e63ccc40e1605dd81 Mon Sep 17 00:00:00 2001 From: lisk77 Date: Fri, 14 Mar 2025 10:43:08 +0100 Subject: [PATCH] fix: stray println in `oklcha` creation method that i forgot to remove and forgot to convert degrees to radians in a conversion :thumbs-up: --- crates/comet_colors/src/oklcha.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/comet_colors/src/oklcha.rs b/crates/comet_colors/src/oklcha.rs index 4388c7c..083f433 100644 --- a/crates/comet_colors/src/oklcha.rs +++ b/crates/comet_colors/src/oklcha.rs @@ -10,7 +10,6 @@ pub struct Oklcha { impl Oklcha { pub fn new(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self { - println!("lightness: {}, chroma: {}, hue: {}, alpha: {}", lightness, chroma, hue, alpha); assert!((0.0..=1.0).contains(&lightness) && (0.0..=1.0).contains(&chroma) && (0.0..=360.0).contains(&hue) && (0.0..=1.0).contains(&alpha), "Ligthness needs to be in range 0..1\nChroma needs to be in range 0..1\nHue needs to be in range 0..360\nAlpha needs to be in range 0..1"); Self { lightness, @@ -49,8 +48,8 @@ impl Oklcha { pub fn to_oklaba(&self) -> Oklaba { Oklaba::new( self.lightness(), - self.chroma() * self.hue().cos(), - self.chroma() * self.hue().sin(), + self.chroma() * self.hue().to_radians().cos(), + self.chroma() * self.hue().to_radians().sin(), self.alpha() ) }