43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
|
package o;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.graphics.Color;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
import o.C17052tZT;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class weT {
|
||
|
private static final int b = (int) Math.round(5.1000000000000005d);
|
||
|
public final boolean a;
|
||
|
private final float c;
|
||
|
public final int d;
|
||
|
private final int e;
|
||
|
private final int h;
|
||
|
|
||
|
public weT(Context context) {
|
||
|
this(TZc.b(context, C17052tZT.IeS.elevationOverlayEnabled, false), C16021kYS.d(context, C17052tZT.IeS.elevationOverlayColor, 0), C16021kYS.d(context, C17052tZT.IeS.elevationOverlayAccentColor, 0), C16021kYS.d(context, C17052tZT.IeS.colorSurface, 0), context.getResources().getDisplayMetrics().density);
|
||
|
}
|
||
|
|
||
|
private weT(boolean z, int i, int i2, int i3, float f) {
|
||
|
this.a = z;
|
||
|
this.h = i;
|
||
|
this.e = i2;
|
||
|
this.d = i3;
|
||
|
this.c = f;
|
||
|
}
|
||
|
|
||
|
public final int c(int i, float f) {
|
||
|
int i2;
|
||
|
if (!this.a || Rez.d(i, 255) != this.d) {
|
||
|
return i;
|
||
|
}
|
||
|
float min = (this.c <= BitmapDescriptorFactory.HUE_RED || f <= BitmapDescriptorFactory.HUE_RED) ? 0.0f : Math.min(((((float) Math.log1p(f / r1)) * 4.5f) + 2.0f) / 100.0f, 1.0f);
|
||
|
int alpha = Color.alpha(i);
|
||
|
int a = Rez.a(Rez.d(this.h, Math.round(Color.alpha(r0) * min)), Rez.d(i, 255));
|
||
|
if (min > BitmapDescriptorFactory.HUE_RED && (i2 = this.e) != 0) {
|
||
|
a = Rez.a(Rez.d(i2, b), a);
|
||
|
}
|
||
|
return Rez.d(a, alpha);
|
||
|
}
|
||
|
}
|