From a980db505bcb3c7a914808736e42f6a8487ae1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 14 Jan 2025 11:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A0=E6=AD=A3=E9=A2=9C=E8=89=B2=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E6=97=B6=E7=9B=B8=E5=87=8F=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- color-module/src/color_differ/cam16jch.rs | 6 +++--- color-module/src/color_differ/hsl.rs | 6 +++--- color-module/src/color_differ/oklch.rs | 6 +++--- color-module/src/color_differ/rgb.rs | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/color-module/src/color_differ/cam16jch.rs b/color-module/src/color_differ/cam16jch.rs index 3e86cd5..7dc1d41 100644 --- a/color-module/src/color_differ/cam16jch.rs +++ b/color-module/src/color_differ/cam16jch.rs @@ -16,9 +16,9 @@ impl ColorDifference for Cam16Jch { type Difference = HctDiffference; fn difference(&self, other: &Self) -> Self::Difference { - let hue = self.hue.into_positive_degrees() - other.hue.into_positive_degrees(); - let chroma = self.chroma - other.chroma; - let lightness = self.lightness - other.lightness; + let hue = other.hue.into_positive_degrees() - self.hue.into_positive_degrees(); + let chroma = other.chroma - self.chroma; + let lightness = other.lightness - self.lightness; HctDiffference { hue: Differ { diff --git a/color-module/src/color_differ/hsl.rs b/color-module/src/color_differ/hsl.rs index 645fd8c..4a691f9 100644 --- a/color-module/src/color_differ/hsl.rs +++ b/color-module/src/color_differ/hsl.rs @@ -16,9 +16,9 @@ impl ColorDifference for Hsl { type Difference = HSLDifference; fn difference(&self, other: &Self) -> Self::Difference { - let hue = self.hue.into_positive_degrees() - other.hue.into_positive_degrees(); - let saturation = self.saturation - other.saturation; - let lightness = self.lightness - other.lightness; + let hue = other.hue.into_positive_degrees() - self.hue.into_positive_degrees(); + let saturation = other.saturation - self.saturation; + let lightness = other.lightness - self.lightness; HSLDifference { hue: Differ { diff --git a/color-module/src/color_differ/oklch.rs b/color-module/src/color_differ/oklch.rs index fedde47..92ba3b0 100644 --- a/color-module/src/color_differ/oklch.rs +++ b/color-module/src/color_differ/oklch.rs @@ -16,9 +16,9 @@ impl ColorDifference for Oklch { type Difference = OklchDifference; fn difference(&self, other: &Self) -> Self::Difference { - let hue = self.hue.into_positive_degrees() - other.hue.into_positive_degrees(); - let chroma = self.chroma - other.chroma; - let lightness = self.l - other.l; + let hue = other.hue.into_positive_degrees() - self.hue.into_positive_degrees(); + let chroma = other.chroma - self.chroma; + let lightness = other.l - self.l; OklchDifference { hue: Differ { diff --git a/color-module/src/color_differ/rgb.rs b/color-module/src/color_differ/rgb.rs index f959dd9..3ac4b2d 100644 --- a/color-module/src/color_differ/rgb.rs +++ b/color-module/src/color_differ/rgb.rs @@ -16,9 +16,9 @@ impl ColorDifference for Srgb { type Difference = RGBDifference; fn difference(&self, other: &Self) -> Self::Difference { - let r = self.red - other.red; - let g = self.green - other.green; - let b = self.blue - other.blue; + let r = other.red - self.red; + let g = other.green - self.green; + let b = other.blue - self.blue; RGBDifference { r: Differ {