implement gradient from tag color to grey
This commit is contained in:
parent
593360c2aa
commit
df9060798d
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ public class TagDTO {
|
||||||
final DB_Tag.Type type;
|
final DB_Tag.Type type;
|
||||||
|
|
||||||
public TagDTO(int grade, DB_Tag.Type type) {
|
public TagDTO(int grade, DB_Tag.Type type) {
|
||||||
this.gradeColor = calcGradient(grade);
|
this.gradeColor = calcGradient(grade, type);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@ public class TagDTO {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calcGradient(int grade){
|
private static int calcGradient(int grade, DB_Tag.Type type){
|
||||||
if (grade < 1)
|
if (grade < 1)
|
||||||
return 0xaaaaaa;
|
return 0xaaaaaa;
|
||||||
|
|
||||||
return ColorUtil.interpolate(
|
return ColorUtil.interpolate(
|
||||||
0x00ff00,
|
0xaaaaaa,
|
||||||
0xff0000,
|
type.getColor(),
|
||||||
computeOffset(0, 10, grade));
|
computeOffset(0, 10, grade));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue