From: Damyan Ivanov Date: Sun, 3 Mar 2019 09:27:23 +0000 (+0200) Subject: HueRing: allow selecting the default hue which is not divisable by 15 X-Git-Tag: v0.7~21 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=b3fd354e14e2628557ee19bbacc05a70ffbcda6c;p=mobile-ledger.git HueRing: allow selecting the default hue which is not divisable by 15 --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java b/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java index 493e6658..3f6dbb92 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java @@ -100,10 +100,12 @@ public class HueRing extends View { return hueDegrees; } public void setHue(int hueDegrees) { - // round to 15 degrees - int rem = hueDegrees % 15; - if (rem < 8) hueDegrees -= rem; - else hueDegrees += 15 - rem; + if (hueDegrees != Colors.DEFAULT_HUE_DEG) { + // round to 15 degrees + int rem = hueDegrees % 15; + if (rem < 8) hueDegrees -= rem; + else hueDegrees += 15 - rem; + } this.hueDegrees = hueDegrees; this.color = Colors.getPrimaryColorForHue(hueDegrees);