调整HCT的相对颜色分析计算。

This commit is contained in:
徐涛 2025-01-14 11:27:59 +08:00
parent e90e88954a
commit 4ba51e018d
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ impl ColorDifference for Cam16Jch<f32> {
0.0 0.0
} else { } else {
(other.hue.into_positive_degrees() - self.hue.into_positive_degrees()) (other.hue.into_positive_degrees() - self.hue.into_positive_degrees())
/ (1.0 - self.hue.into_positive_degrees()) / (360.0 - self.hue.into_positive_degrees())
}; };
let chroma = if self.chroma == 0.0 { let chroma = if self.chroma == 0.0 {
0.0 0.0
@ -51,7 +51,7 @@ impl ColorDifference for Cam16Jch<f32> {
let lightness = if self.lightness == 0.0 { let lightness = if self.lightness == 0.0 {
0.0 0.0
} else { } else {
(other.lightness - self.lightness) / self.lightness (other.lightness - self.lightness) / (100.0 - self.lightness)
}; };
HctDiffference { HctDiffference {