generated from Grigo/AndroidTemplate
fix elevation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user