From 374fc2c9972a157b258eabe897b0ae6dc38dc5b1 Mon Sep 17 00:00:00 2001 From: chompaa Date: Tue, 19 Mar 2024 17:31:25 -0400 Subject: [PATCH] Make `Oklab` and `Oklch` color spaces consistent --- crates/bevy_color/src/oklaba.rs | 4 ++-- crates/bevy_color/src/oklcha.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bevy_color/src/oklaba.rs b/crates/bevy_color/src/oklaba.rs index 2ec202a2fa22b..9a04a2e18adf4 100644 --- a/crates/bevy_color/src/oklaba.rs +++ b/crates/bevy_color/src/oklaba.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] #[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Oklaba { - /// The 'l' channel. [0.0, 1.0] + /// The 'lightness' channel. [0.0, 1.0] pub lightness: f32, /// The 'a' channel. [-1.0, 1.0] pub a: f32, @@ -59,7 +59,7 @@ impl Oklaba { } } - /// Return a copy of this color with the 'l' channel set to the given value. + /// Return a copy of this color with the 'lightness' channel set to the given value. pub const fn with_lightness(self, lightness: f32) -> Self { Self { lightness, ..self } } diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs index 4185990e5d416..133794e256b35 100644 --- a/crates/bevy_color/src/oklcha.rs +++ b/crates/bevy_color/src/oklcha.rs @@ -56,17 +56,17 @@ impl Oklcha { } /// Return a copy of this color with the 'lightness' channel set to the given value. - pub const fn with_l(self, lightness: f32) -> Self { + pub const fn with_lightness(self, lightness: f32) -> Self { Self { lightness, ..self } } /// Return a copy of this color with the 'chroma' channel set to the given value. - pub const fn with_c(self, chroma: f32) -> Self { + pub const fn with_chroma(self, chroma: f32) -> Self { Self { chroma, ..self } } /// Return a copy of this color with the 'hue' channel set to the given value. - pub const fn with_h(self, hue: f32) -> Self { + pub const fn with_hue(self, hue: f32) -> Self { Self { hue, ..self } }