Skip to content

Commit

Permalink
Update ColorSchema.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 committed Nov 10, 2024
1 parent 6e5e0a4 commit 8b3507a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ DoubleFunction<Color> buildColorFunction(ResourceManager resourceManager)
// Transition between yellow and black
if (p > 0.6)
{
// 0.6 to 1.0 to 0 to 1.0
// 0.6 to 1.0 to (0 to 1.0 buchen's normalization)
float blackFactor = (float) ((p - 0.6) / 0.4);
color = Colors.interpolate(Colors.YELLOW.getRGB(), Colors.BLACK.getRGB(), blackFactor);
}
Expand Down Expand Up @@ -141,7 +141,6 @@ DoubleFunction<Color> buildColorFunction(ResourceManager resourceManager)
*/
private double normalizePerformance(double performance)
{
// -0.05 + 0.07 / (2 * 0.07) = 0.02 / 0.14 = -0.14285714285714285
performance = Math.max(-MAX_PERFORMANCE, performance);
performance = Math.min(MAX_PERFORMANCE, performance);
return (performance + MAX_PERFORMANCE) / (2 * MAX_PERFORMANCE);
Expand Down

0 comments on commit 8b3507a

Please sign in to comment.