implement gradient from tag color to grey

This commit is contained in:
Hiajen Hiajen 2021-06-25 22:02:56 +02:00
parent 593360c2aa
commit df9060798d

View file

@ -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));
}
}