package net.saltymc.eaa.custom.ping; import net.saltymc.eaa.util.database.DB_Tag; import static net.saltymc.eaa.custom.ping.PingColors.computeOffset; public class TagDTO { final int grade; final int gradeColor; final DB_Tag.Type type; public TagDTO(int grade, DB_Tag.Type type) { this.grade = grade; this.gradeColor = calcGradient(grade, type); this.type = type; } public int getGradeColor() { return gradeColor; } public DB_Tag.Type getType() { return type; } private static int calcGradient(int grade, DB_Tag.Type type){ if (grade < 1) return 0xaaaaaa; return ColorUtil.interpolate( 0xaaaaaa, type.getColor(), computeOffset(0, 10, grade)); } public int getGrade(){ return grade; } }