Resolves #161 Colors for more then 10 states in history

This commit is contained in:
Yegor Vialov
2018-11-04 21:36:15 +02:00
parent bb17885b4a
commit 790446d592
2 changed files with 6 additions and 4 deletions

View File

@ -33,7 +33,8 @@ class EntityColors {
a: c.alpha
);
} else {
return charts.MaterialPalette.getOrderedPalettes(id+1)[id].shadeDefault;
double r = id.toDouble() % 10;
return charts.MaterialPalette.getOrderedPalettes(10)[r.round()].shadeDefault;
}
}
@ -43,7 +44,8 @@ class EntityColors {
return c;
} else {
if (id > -1) {
charts.Color c1 = charts.MaterialPalette.getOrderedPalettes(id + 1)[id].shadeDefault;
double r = id.toDouble() % 10;
charts.Color c1 = charts.MaterialPalette.getOrderedPalettes(10)[r.round()].shadeDefault;
return Color.fromARGB(c1.a, c1.r, c1.g, c1.b);
} else {
return _stateColors["on"];