From cc575a70c800313d2cc5b4da090dcfa016b2bf5c Mon Sep 17 00:00:00 2001 From: zelophed Date: Sat, 7 Aug 2021 02:46:16 +0200 Subject: [PATCH] flash mich nochmal - fix ponder buttons not flashing correctly --- .../create/foundation/ponder/ui/PonderButton.java | 4 ++-- .../com/simibubi/create/foundation/utility/Color.java | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java b/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java index b4cdd9f4c..bce4be1b4 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java @@ -83,8 +83,8 @@ public class PonderButton extends BoxWidget { sin *= flashValue; Color nc1 = new Color(255, 255, 255, MathHelper.clamp(gradientColor1.getAlpha() + 150, 0, 255)); Color nc2 = new Color(155, 155, 155, MathHelper.clamp(gradientColor2.getAlpha() + 150, 0, 255)); - gradientColor1.mixWith(nc1, sin); - gradientColor2.mixWith(nc2, sin); + gradientColor1 = gradientColor1.mixWith(nc1, sin); + gradientColor2 = gradientColor2.mixWith(nc2, sin); } } diff --git a/src/main/java/com/simibubi/create/foundation/utility/Color.java b/src/main/java/com/simibubi/create/foundation/utility/Color.java index 3525cb5c9..1872f3be0 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/Color.java +++ b/src/main/java/com/simibubi/create/foundation/utility/Color.java @@ -199,8 +199,13 @@ public class Color { } public Color darker() { - //todo - return ensureMutable(); + int a = getAlpha(); + return ensureMutable().mixWith(BLACK, .25f).setAlphaUnchecked(a); + } + + public Color brighter() { + int a = getAlpha(); + return ensureMutable().mixWith(WHITE, .25f).setAlphaUnchecked(a); } public Color setValue(int value) {