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 {