From df9060798d71960718eddb4e2ed3edfa77108934 Mon Sep 17 00:00:00 2001 From: "Ansgar [Hiajen]" Date: Fri, 25 Jun 2021 22:02:56 +0200 Subject: [PATCH] implement gradient from tag color to grey --- src/main/java/net/saltymc/eaa/custom/ping/TagDTO.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/saltymc/eaa/custom/ping/TagDTO.java b/src/main/java/net/saltymc/eaa/custom/ping/TagDTO.java index f9d63b3..42c14e8 100644 --- a/src/main/java/net/saltymc/eaa/custom/ping/TagDTO.java +++ b/src/main/java/net/saltymc/eaa/custom/ping/TagDTO.java @@ -9,7 +9,7 @@ public class TagDTO { final DB_Tag.Type type; public TagDTO(int grade, DB_Tag.Type type) { - this.gradeColor = calcGradient(grade); + this.gradeColor = calcGradient(grade, type); this.type = type; } @@ -21,13 +21,13 @@ public class TagDTO { return type; } - private static int calcGradient(int grade){ + private static int calcGradient(int grade, DB_Tag.Type type){ if (grade < 1) return 0xaaaaaa; return ColorUtil.interpolate( - 0x00ff00, - 0xff0000, + 0xaaaaaa, + type.getColor(), computeOffset(0, 10, grade)); } }