Skip to content

Commit

Permalink
Reduce the aggressiveness of the HSV adjustments to color buttons (#8203
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pupnewfster committed Aug 26, 2024
1 parent dc455c6 commit bfeebf8
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ public BasicColorButton(IGuiWrapper gui, int x, int y, int size, Supplier<EnumCo
@Override
public void drawBackground(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
EnumColor color = getColor();
boolean doColor = color != null && color != EnumColor.GRAY;
if (doColor) {
if (color != null) {
Color c = Color.rgb(color.getRgbCode());
double[] hsv = c.hsvArray();
hsv[1] = Math.max(0, hsv[1] - 0.25F);
hsv[2] = Math.min(1, hsv[2] + 0.4F);
hsv[1] = Math.max(0, hsv[1] - 0.1);
hsv[2] = Math.min(1, hsv[2] + 0.1);
MekanismRenderer.color(guiGraphics, Color.hsv(hsv[0], hsv[1], hsv[2]));
} else {
MekanismRenderer.resetColor(guiGraphics);
}
super.drawBackground(guiGraphics, mouseX, mouseY, partialTicks);
if (doColor) {
if (color != null) {
MekanismRenderer.resetColor(guiGraphics);
}
}
Expand Down

0 comments on commit bfeebf8

Please sign in to comment.