|
@@ -3,7 +3,11 @@ const metrics = {
|
|
|
option: "Geometric Difference (α)",
|
|
|
displayName: String.raw`\alpha`,
|
|
|
displayBody: p => String.raw`
|
|
|
- \sigma\left(${p}\right)^{2 - L\left(\vec{q}\right)} \Theta\left(${p}\right)^{L\left(\vec{q}\right)}
|
|
|
+ \frac{
|
|
|
+ \sigma\left(${p}\right)^{1 - (C\left(\left\{\vec{q}\right\}\right) - L\left(\left\{\vec{q}\right\}\right))}
|
|
|
+ }{
|
|
|
+ \Theta\left(${p}\right)^{-1 - (C\left(\left\{\vec{q}\right\}\right) - L\left(\left\{\vec{q}\right\}\right))}
|
|
|
+ }
|
|
|
`,
|
|
|
evaluate: () => 0, // calculated below
|
|
|
},
|
|
@@ -127,6 +131,7 @@ const applyMetrics = (data, target) => {
|
|
|
Object.entries(metrics)
|
|
|
.map(([name, metric]) => [name, metric.evaluate(data, target)])
|
|
|
);
|
|
|
- scores.alpha = Math.pow(scores.sigma, 2 - target.lightness) * Math.pow(scores.bigTheta, target.lightness);
|
|
|
+ const power = target.chroma + 1 - target.lightness;
|
|
|
+ scores.alpha = Math.pow(scores.sigma, 2 - power) * Math.pow(scores.bigTheta, power);
|
|
|
return scores;
|
|
|
};
|