Skip to content

Commit

Permalink
Use available constants when calculating cutover from yellow to black
Browse files Browse the repository at this point in the history
Issue: #4306
  • Loading branch information
buchen committed Nov 29, 2024
1 parent 7ea526e commit 9069fe2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum ColorSchema
BLUE_GRAY_ORANGE(Messages.LabelBlueGrayOrange), //
YELLOW_WHITE_BLACK(Messages.LabelYellowWhiteBlack);

private static final double MAX_PERFORMANCE = 0.07f;
private static final float MAX_PERFORMANCE = 0.07f;

private String label;

Expand Down Expand Up @@ -66,7 +66,7 @@ DoubleFunction<Color> buildColorFunction(ResourceManager resourceManager)
var p = normalizePerformance(performance);

// cutover from yellow to black at +0.05 performance
var cutover = (0.07f + 0.05f) / 0.14f;
var cutover = (MAX_PERFORMANCE + 0.05f) / 2f * MAX_PERFORMANCE;

return new ColorGradient(//
new ColorPoint(Colors.theme().defaultBackground(), 0), //
Expand Down

0 comments on commit 9069fe2

Please sign in to comment.