fix elevation

This commit is contained in:
2026-06-16 11:54:41 +03:00
parent 0e1fa15a2f
commit 6b34e75f35
4 changed files with 172 additions and 33 deletions
@@ -772,8 +772,21 @@ public class MapFragment extends Fragment {
private static int qualityArgb(double pct) {
double p = Math.max(0.0, Math.min(100.0, pct));
int r = p < 50.0 ? (int) Math.round(255.0 * (p / 50.0)) : 255;
int g = p < 50.0 ? 255 : (int) Math.round(255.0 * (1.0 - (p - 50.0) / 50.0));
int r;
int g;
if (p < 40.0) {
double t = p / 40.0;
r = 255;
g = (int) Math.round(140.0 * t);
} else if (p < 85.0) {
double t = (p - 40.0) / 45.0;
r = 255;
g = (int) Math.round(140.0 + 115.0 * t);
} else {
double t = (p - 85.0) / 15.0;
r = (int) Math.round(255.0 * (1.0 - t));
g = 255;
}
return 0xFF000000 | (r << 16) | (g << 8);
}