From 14cc6b505a639fc7aad22d36d9a371d37f9915ad Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Tue, 3 Jun 2025 16:04:58 -0400 Subject: [PATCH 1/5] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 606f7a0..fad8f43 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk +# IDEs and Editors +.idea/ +.vscode/ \ No newline at end of file From 65f0032296797459a7349e5efea5bc95177ac471 Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Tue, 3 Jun 2025 16:05:16 -0400 Subject: [PATCH 2/5] Add tuple variants --- src/color.rs | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/src/color.rs b/src/color.rs index 52eb942..6d47b93 100644 --- a/src/color.rs +++ b/src/color.rs @@ -230,6 +230,18 @@ impl Color { ] } + /// Returns: `(r, g, b, a)` + /// + /// * Red, green, blue and alpha in the range [0..1] + pub fn to_tuple(&self) -> (f32, f32, f32, f32) { + ( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + self.a.clamp(0.0, 1.0), + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..255] @@ -242,6 +254,18 @@ impl Color { ] } + /// Returns: `(r, g, b, a)` + /// + /// * Red, green, blue and alpha in the range [0..255] + pub fn to_rgba8_tuple(&self) -> (u8, u8, u8, u8) { + ( + (self.r * 255.0 + 0.5) as u8, + (self.g * 255.0 + 0.5) as u8, + (self.b * 255.0 + 0.5) as u8, + (self.a * 255.0 + 0.5) as u8, + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..65535] @@ -254,6 +278,18 @@ impl Color { ] } + /// Returns: `(r, g, b, a)` + /// + /// * Red, green, blue and alpha in the range [0..65535] + pub fn to_rgba16_tuple(&self) -> (u16, u16, u16, u16) { + ( + (self.r * 65535.0 + 0.5) as u16, + (self.g * 65535.0 + 0.5) as u16, + (self.b * 65535.0 + 0.5) as u16, + (self.a * 65535.0 + 0.5) as u16, + ) + } + /// Returns: `[h, s, v, a]` /// /// * `h`: Hue angle [0..360] @@ -274,6 +310,26 @@ impl Color { ] } + /// Returns: `(h, s, v, a)` + /// + /// * `h`: Hue angle [0..360] + /// * `s`: Saturation [0..1] + /// * `v`: Value [0..1] + /// * `a`: Alpha [0..1] + pub fn to_hsva_tuple(&self) -> (f32, f32, f32, f32) { + let [h, s, v] = rgb_to_hsv( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + ( + h, + s.clamp(0.0, 1.0), + v.clamp(0.0, 1.0), + self.a.clamp(0.0, 1.0), + ) + } + /// Returns: `[h, s, l, a]` /// /// * `h`: Hue angle [0..360] @@ -294,6 +350,26 @@ impl Color { ] } + /// Returns: `(h, s, l, a)` + /// + /// * `h`: Hue angle [0..360] + /// * `s`: Saturation [0..1] + /// * `l`: Lightness [0..1] + /// * `a`: Alpha [0..1] + pub fn to_hsla_tuple(&self) -> (f32, f32, f32, f32) { + let [h, s, l] = rgb_to_hsl( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + ( + h, + s.clamp(0.0, 1.0), + l.clamp(0.0, 1.0), + self.a.clamp(0.0, 1.0), + ) + } + /// Returns: `[h, w, b, a]` /// /// * `h`: Hue angle [0..360] @@ -314,6 +390,26 @@ impl Color { ] } + /// Returns: `(h, w, b, a)` + /// + /// * `h`: Hue angle [0..360] + /// * `w`: Whiteness [0..1] + /// * `b`: Blackness [0..1] + /// * `a`: Alpha [0..1] + pub fn to_hwba_tuple(&self) -> (f32, f32, f32, f32) { + let [h, w, b] = rgb_to_hwb( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + ( + h, + w.clamp(0.0, 1.0), + b.clamp(0.0, 1.0), + self.a.clamp(0.0, 1.0), + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..1] @@ -332,6 +428,24 @@ impl Color { ] } + /// Returns: `(r, g, b, a)` + /// + /// * Red, green, blue and alpha in the range [0..1] + pub fn to_linear_rgba_tuple(&self) -> (f32, f32, f32, f32) { + fn to_linear(x: f32) -> f32 { + if x >= 0.04045 { + return ((x + 0.055) / 1.055).powf(2.4); + } + x / 12.92 + } + ( + to_linear(self.r), + to_linear(self.g), + to_linear(self.b), + self.a, + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..255] @@ -345,6 +459,19 @@ impl Color { ] } + /// Returns: `(r, g, b, a)` + /// + /// * Red, green, blue and alpha in the range [0..255] + pub fn to_linear_rgba_u8_tuple(&self) -> (u8, u8, u8, u8) { + let (r, g, b, a) = self.to_linear_rgba_tuple(); + ( + (r * 255.0).round() as u8, + (g * 255.0).round() as u8, + (b * 255.0).round() as u8, + (a * 255.0).round() as u8, + ) + } + /// Returns: `[l, a, b, alpha]` pub fn to_oklaba(&self) -> [f32; 4] { let [r, g, b, _] = self.to_linear_rgba(); @@ -352,6 +479,13 @@ impl Color { [l, a, b, self.a.clamp(0.0, 1.0)] } + /// Returns: `(l, a, b, alpha)` + pub fn to_oklaba_tuple(&self) -> (f32, f32, f32, f32) { + let [r, g, b, _] = self.to_linear_rgba(); + let [l, a, b] = linear_rgb_to_oklab(r, g, b); + (l, a, b, self.a.clamp(0.0, 1.0)) + } + /// Returns: `[l, c, h, alpha]` pub fn to_oklcha(&self) -> [f32; 4] { let [l, a, b, alpha] = self.to_oklaba(); @@ -360,6 +494,14 @@ impl Color { [l, c, h, alpha] } + /// Returns: `(l, c, h, alpha)` + pub fn to_oklcha_tuple(&self) -> (f32, f32, f32, f32) { + let (l, a, b, alpha) = self.to_oklaba_tuple(); + let c = (a * a + b * b).sqrt(); + let h = b.atan2(a); + (l, c, h, alpha) + } + #[cfg(feature = "lab")] /// Returns: `[l, a, b, alpha]` pub fn to_laba(&self) -> [f32; 4] { @@ -368,6 +510,14 @@ impl Color { [l, a, b, alpha.clamp(0.0, 1.0)] } + #[cfg(feature = "lab")] + /// Returns: `(l, a, b, alpha)` + pub fn to_laba_tuple(&self) -> (f32, f32, f32, f32) { + let [r, g, b, alpha] = self.to_linear_rgba(); + let [l, a, b] = linear_rgb_to_lab(r, g, b); + (l, a, b, alpha.clamp(0.0, 1.0)) + } + #[cfg(feature = "lab")] /// Returns: `[l, c, h, alpha]` pub fn to_lcha(&self) -> [f32; 4] { @@ -377,6 +527,15 @@ impl Color { [l, c, h, alpha.clamp(0.0, 1.0)] } + #[cfg(feature = "lab")] + /// Returns: `(l, c, h, alpha)` + pub fn to_lcha_tuple(&self) -> (f32, f32, f32, f32) { + let (l, a, b, alpha) = self.to_laba_tuple(); + let c = (a * a + b * b).sqrt(); + let h = b.atan2(a); + (l, c, h, alpha.clamp(0.0, 1.0)) + } + /// Get CSS RGB hexadecimal color representation pub fn to_css_hex(&self) -> String { let [r, g, b, a] = self.to_rgba8(); From 4a36b8f14ed3442502985cfa87f0d47ac1b1259f Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Tue, 3 Jun 2025 16:38:01 -0400 Subject: [PATCH 3/5] Add non-alpha variants --- src/color.rs | 284 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 284 insertions(+) diff --git a/src/color.rs b/src/color.rs index 6d47b93..3548803 100644 --- a/src/color.rs +++ b/src/color.rs @@ -56,6 +56,15 @@ impl Color { } } + /// Arguments: + /// + /// * `r`: Red value [0..255] + /// * `g`: Green value [0..255] + /// * `b`: Blue value [0..255] + pub fn from_rgb8(r: u8, g: u8, b: u8) -> Self { + Self::from_rgba8(r, g, b, 255) + } + /// Arguments: /// /// * `r`: Red value [0..1] @@ -72,6 +81,7 @@ impl Color { Self::new(from_linear(r), from_linear(g), from_linear(b), a) } + /// Arguments: /// /// * `r`: Red value [0..255] @@ -254,6 +264,17 @@ impl Color { ] } + /// Returns: `[r, g, b]` + /// + /// * Red, green, and blue in the range [0..255] + pub fn to_rgb8(&self) -> [u8; 3] { + [ + (self.r * 255.0 + 0.5) as u8, + (self.g * 255.0 + 0.5) as u8, + (self.b * 255.0 + 0.5) as u8, + ] + } + /// Returns: `(r, g, b, a)` /// /// * Red, green, blue and alpha in the range [0..255] @@ -266,6 +287,17 @@ impl Color { ) } + /// Returns: `(r, g, b)` + /// + /// * Red, green, and blue in the range [0..255] + pub fn to_rgb8_tuple(&self) -> (u8, u8, u8) { + ( + (self.r * 255.0 + 0.5) as u8, + (self.g * 255.0 + 0.5) as u8, + (self.b * 255.0 + 0.5) as u8, + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..65535] @@ -278,6 +310,17 @@ impl Color { ] } + /// Returns: `[r, g, b]` + /// + /// * Red, green, and blue in the range [0..65535] + pub fn to_rgb16(&self) -> [u16; 3] { + [ + (self.r * 65535.0 + 0.5) as u16, + (self.g * 65535.0 + 0.5) as u16, + (self.b * 65535.0 + 0.5) as u16, + ] + } + /// Returns: `(r, g, b, a)` /// /// * Red, green, blue and alpha in the range [0..65535] @@ -290,6 +333,17 @@ impl Color { ) } + /// Returns: `(r, g, b)` + /// + /// * Red, green, and blue in the range [0..65535] + pub fn to_rgb16_tuple(&self) -> (u16, u16, u16) { + ( + (self.r * 65535.0 + 0.5) as u16, + (self.g * 65535.0 + 0.5) as u16, + (self.b * 65535.0 + 0.5) as u16, + ) + } + /// Returns: `[h, s, v, a]` /// /// * `h`: Hue angle [0..360] @@ -310,6 +364,24 @@ impl Color { ] } + /// Returns: `[h, s, v]` + /// + /// * `h`: Hue angle [0..360] + /// * `s`: Saturation [0..1] + /// * `v`: Value [0..1] + pub fn to_hsv(&self) -> [f32; 3] { + let [h, s, v] = rgb_to_hsv( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + [ + h, + s.clamp(0.0, 1.0), + v.clamp(0.0, 1.0), + ] + } + /// Returns: `(h, s, v, a)` /// /// * `h`: Hue angle [0..360] @@ -330,6 +402,24 @@ impl Color { ) } + /// Returns: `(h, s, v)` + /// + /// * `h`: Hue angle [0..360] + /// * `s`: Saturation [0..1] + /// * `v`: Value [0..1] + pub fn to_hsv_tuple(&self) -> (f32, f32, f32) { + let [h, s, v] = rgb_to_hsv( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + ( + h, + s.clamp(0.0, 1.0), + v.clamp(0.0, 1.0), + ) + } + /// Returns: `[h, s, l, a]` /// /// * `h`: Hue angle [0..360] @@ -350,6 +440,24 @@ impl Color { ] } + /// Returns: `[h, s, l]` + /// + /// * `h`: Hue angle [0..360] + /// * `s`: Saturation [0..1] + /// * `l`: Lightness [0..1] + pub fn to_hsl(&self) -> [f32; 3] { + let [h, s, l] = rgb_to_hsl( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + [ + h, + s.clamp(0.0, 1.0), + l.clamp(0.0, 1.0), + ] + } + /// Returns: `(h, s, l, a)` /// /// * `h`: Hue angle [0..360] @@ -370,6 +478,24 @@ impl Color { ) } + /// Returns: `(h, s, l)` + /// + /// * `h`: Hue angle [0..360] + /// * `s`: Saturation [0..1] + /// * `l`: Lightness [0..1] + pub fn to_hsl_tuple(&self) -> (f32, f32, f32) { + let [h, s, l] = rgb_to_hsl( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + ( + h, + s.clamp(0.0, 1.0), + l.clamp(0.0, 1.0), + ) + } + /// Returns: `[h, w, b, a]` /// /// * `h`: Hue angle [0..360] @@ -390,6 +516,24 @@ impl Color { ] } + /// Returns: `[h, w, b]` + /// + /// * `h`: Hue angle [0..360] + /// * `w`: Whiteness [0..1] + /// * `b`: Blackness [0..1] + pub fn to_hwb(&self) -> [f32; 3] { + let [h, w, b] = rgb_to_hwb( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + [ + h, + w.clamp(0.0, 1.0), + b.clamp(0.0, 1.0), + ] + } + /// Returns: `(h, w, b, a)` /// /// * `h`: Hue angle [0..360] @@ -410,6 +554,24 @@ impl Color { ) } + /// Returns: `(h, w, b)` + /// + /// * `h`: Hue angle [0..360] + /// * `w`: Whiteness [0..1] + /// * `b`: Blackness [0..1] + pub fn to_hwb_tuple(&self) -> (f32, f32, f32) { + let [h, w, b] = rgb_to_hwb( + self.r.clamp(0.0, 1.0), + self.g.clamp(0.0, 1.0), + self.b.clamp(0.0, 1.0), + ); + ( + h, + w.clamp(0.0, 1.0), + b.clamp(0.0, 1.0), + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..1] @@ -428,6 +590,23 @@ impl Color { ] } + /// Returns: `[r, g, b]` + /// + /// * Red, green, and blue in the range [0..1] + pub fn to_linear_rgb(&self) -> [f32; 3] { + fn to_linear(x: f32) -> f32 { + if x >= 0.04045 { + return ((x + 0.055) / 1.055).powf(2.4); + } + x / 12.92 + } + [ + to_linear(self.r), + to_linear(self.g), + to_linear(self.b), + ] + } + /// Returns: `(r, g, b, a)` /// /// * Red, green, blue and alpha in the range [0..1] @@ -446,6 +625,23 @@ impl Color { ) } + /// Returns: `(r, g, b)` + /// + /// * Red, green, and blue in the range [0..1] + pub fn to_linear_rgb_tuple(&self) -> (f32, f32, f32) { + fn to_linear(x: f32) -> f32 { + if x >= 0.04045 { + return ((x + 0.055) / 1.055).powf(2.4); + } + x / 12.92 + } + ( + to_linear(self.r), + to_linear(self.g), + to_linear(self.b), + ) + } + /// Returns: `[r, g, b, a]` /// /// * Red, green, blue and alpha in the range [0..255] @@ -459,6 +655,18 @@ impl Color { ] } + /// Returns: `[r, g, b]` + /// + /// * Red, green, and blue in the range [0..255] + pub fn to_linear_rgb_u8(&self) -> [u8; 3] { + let [r, g, b] = self.to_linear_rgb(); + [ + (r * 255.0).round() as u8, + (g * 255.0).round() as u8, + (b * 255.0).round() as u8, + ] + } + /// Returns: `(r, g, b, a)` /// /// * Red, green, blue and alpha in the range [0..255] @@ -472,6 +680,18 @@ impl Color { ) } + /// Returns: `(r, g, b)` + /// + /// * Red, green, and blue in the range [0..255] + pub fn to_linear_rgb_u8_tuple(&self) -> (u8, u8, u8) { + let (r, g, b) = self.to_linear_rgb_tuple(); + ( + (r * 255.0).round() as u8, + (g * 255.0).round() as u8, + (b * 255.0).round() as u8, + ) + } + /// Returns: `[l, a, b, alpha]` pub fn to_oklaba(&self) -> [f32; 4] { let [r, g, b, _] = self.to_linear_rgba(); @@ -479,6 +699,13 @@ impl Color { [l, a, b, self.a.clamp(0.0, 1.0)] } + /// Returns: `[l, a, b]` + pub fn to_oklab(&self) -> [f32; 3] { + let [r, g, b, _] = self.to_linear_rgba(); + let [l, a, b] = linear_rgb_to_oklab(r, g, b); + [l, a, b] + } + /// Returns: `(l, a, b, alpha)` pub fn to_oklaba_tuple(&self) -> (f32, f32, f32, f32) { let [r, g, b, _] = self.to_linear_rgba(); @@ -486,6 +713,13 @@ impl Color { (l, a, b, self.a.clamp(0.0, 1.0)) } + /// Returns: `(l, a, b)` + pub fn to_oklab_tuple(&self) -> (f32, f32, f32) { + let [r, g, b, _] = self.to_linear_rgba(); + let [l, a, b] = linear_rgb_to_oklab(r, g, b); + (l, a, b) + } + /// Returns: `[l, c, h, alpha]` pub fn to_oklcha(&self) -> [f32; 4] { let [l, a, b, alpha] = self.to_oklaba(); @@ -494,6 +728,14 @@ impl Color { [l, c, h, alpha] } + /// Returns: `[l, c, h]` + pub fn to_oklch(&self) -> [f32; 3] { + let [l, a, b] = self.to_oklab(); + let c = (a * a + b * b).sqrt(); + let h = b.atan2(a); + [l, c, h] + } + /// Returns: `(l, c, h, alpha)` pub fn to_oklcha_tuple(&self) -> (f32, f32, f32, f32) { let (l, a, b, alpha) = self.to_oklaba_tuple(); @@ -502,6 +744,14 @@ impl Color { (l, c, h, alpha) } + /// Returns: `(l, c, h)` + pub fn to_oklch_tuple(&self) -> (f32, f32, f32) { + let (l, a, b) = self.to_oklab_tuple(); + let c = (a * a + b * b).sqrt(); + let h = b.atan2(a); + (l, c, h) + } + #[cfg(feature = "lab")] /// Returns: `[l, a, b, alpha]` pub fn to_laba(&self) -> [f32; 4] { @@ -510,6 +760,14 @@ impl Color { [l, a, b, alpha.clamp(0.0, 1.0)] } + #[cfg(feature = "lab")] + /// Returns: `[l, a, b]` + pub fn to_lab(&self) -> [f32; 3] { + let [r, g, b, _] = self.to_linear_rgba(); + let [l, a, b] = linear_rgb_to_lab(r, g, b); + [l, a, b] + } + #[cfg(feature = "lab")] /// Returns: `(l, a, b, alpha)` pub fn to_laba_tuple(&self) -> (f32, f32, f32, f32) { @@ -518,6 +776,14 @@ impl Color { (l, a, b, alpha.clamp(0.0, 1.0)) } + #[cfg(feature = "lab")] + /// Returns: `(l, a, b)` + pub fn to_lab_tuple(&self) -> (f32, f32, f32) { + let [r, g, b, _] = self.to_linear_rgba(); + let [l, a, b] = linear_rgb_to_lab(r, g, b); + (l, a, b) + } + #[cfg(feature = "lab")] /// Returns: `[l, c, h, alpha]` pub fn to_lcha(&self) -> [f32; 4] { @@ -527,6 +793,15 @@ impl Color { [l, c, h, alpha.clamp(0.0, 1.0)] } + #[cfg(feature = "lab")] + /// Returns: `[l, c, h]` + pub fn to_lch(&self) -> [f32; 3] { + let [l, a, b] = self.to_lab(); + let c = (a * a + b * b).sqrt(); + let h = b.atan2(a); + [l, c, h] + } + #[cfg(feature = "lab")] /// Returns: `(l, c, h, alpha)` pub fn to_lcha_tuple(&self) -> (f32, f32, f32, f32) { @@ -536,6 +811,15 @@ impl Color { (l, c, h, alpha.clamp(0.0, 1.0)) } + #[cfg(feature = "lab")] + /// Returns: `(l, c, h)` + pub fn to_lch_tuple(&self) -> (f32, f32, f32) { + let (l, a, b) = self.to_lab_tuple(); + let c = (a * a + b * b).sqrt(); + let h = b.atan2(a); + (l, c, h) + } + /// Get CSS RGB hexadecimal color representation pub fn to_css_hex(&self) -> String { let [r, g, b, a] = self.to_rgba8(); From c292211973f0a6792cfd83f926a503e194283324 Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Tue, 3 Jun 2025 16:48:15 -0400 Subject: [PATCH 4/5] Add lighten and darken methods --- src/color.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/color.rs b/src/color.rs index 3548803..92c24b2 100644 --- a/src/color.rs +++ b/src/color.rs @@ -956,6 +956,22 @@ impl Color { ) } + /// Lighten this color using HSLA + pub fn lighten(&self, amount: f32) -> Self { + let [h, s, mut l, a] = self.to_hsla(); + l += amount / 100.0; + l = l.clamp(0.0, 1.0); + Self::from_hsla(h, s, l, a) + } + + /// Darken this color using HSLA + pub fn darken(&self, amount: f32) -> Self { + let [h, s, mut l, a] = self.to_hsla(); + l -= amount / 100.0; + l = l.clamp(0.0, 1.0); + Self::from_hsla(h, s, l, a) + } + #[cfg(feature = "lab")] /// Blend this color with the other one, in the Lab color-space. `t` in the range [0..1]. pub fn interpolate_lab(&self, other: &Color, t: f32) -> Self { From f742c61abe3a54427eb5010286ac5f7062936ea6 Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Tue, 3 Jun 2025 17:05:10 -0400 Subject: [PATCH 5/5] Remove duplicate deprecated methods --- src/color2.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/color2.rs b/src/color2.rs index 151acd6..d565934 100644 --- a/src/color2.rs +++ b/src/color2.rs @@ -143,13 +143,6 @@ impl Color { Self::from_laba(l, a, b, alpha) } - #[cfg(feature = "lab")] - #[deprecated = "Use [to_laba](#method.to_laba) instead."] - /// Returns: `[l, a, b, alpha]` - pub fn to_lab(&self) -> [f32; 4] { - self.to_laba() - } - #[cfg(feature = "lab")] #[deprecated = "Use [from_lcha](#method.from_lcha) instead."] /// Arguments: @@ -162,13 +155,6 @@ impl Color { Self::from_lcha(l, c, h, alpha) } - #[cfg(feature = "lab")] - #[deprecated = "Use [to_lcha](#method.to_lcha) instead."] - /// Returns: `[l, c, h, alpha]` - pub fn to_lch(&self) -> [f32; 4] { - self.to_lcha() - } - #[deprecated] /// Returns: `(r, g, b, a)` ///