package k9;

import android.content.Context;
import android.graphics.Color;
import q9.c;

/* JADX INFO: loaded from: classes2.dex */
public final class a {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final int f29081f = (int) Math.round(5.1000000000000005d);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final boolean f29082a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f29083b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f29084c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f29085d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final float f29086e;

    public a(Context context) {
        boolean zA = c.a(context, x8.c.elevationOverlayEnabled, false);
        int iC = h9.a.c(context, x8.c.elevationOverlayColor, 0);
        int iC2 = h9.a.c(context, x8.c.elevationOverlayAccentColor, 0);
        int iC3 = h9.a.c(context, x8.c.colorSurface, 0);
        float f10 = context.getResources().getDisplayMetrics().density;
        this.f29082a = zA;
        this.f29083b = iC;
        this.f29084c = iC2;
        this.f29085d = iC3;
        this.f29086e = f10;
    }

    public final int a(float f10, int i10) {
        int i11;
        if (!this.f29082a || j0.c.e(i10, 255) != this.f29085d) {
            return i10;
        }
        float fMin = (this.f29086e <= 0.0f || f10 <= 0.0f) ? 0.0f : Math.min(((((float) Math.log1p(f10 / r1)) * 4.5f) + 2.0f) / 100.0f, 1.0f);
        int iAlpha = Color.alpha(i10);
        int iE = h9.a.e(fMin, j0.c.e(i10, 255), this.f29083b);
        if (fMin > 0.0f && (i11 = this.f29084c) != 0) {
            iE = j0.c.c(j0.c.e(i11, f29081f), iE);
        }
        return j0.c.e(iE, iAlpha);
    }
}
