package u0;

import android.content.Context;
import android.graphics.Color;
import z0.b;

/* JADX INFO: compiled from: ElevationOverlayProvider.java */
/* JADX INFO: loaded from: classes.dex */
public class a {

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

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

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

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

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

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

    public a(Context context) {
        this(b.b(context, l0.b.f5332o, false), r0.a.b(context, l0.b.f5331n, 0), r0.a.b(context, l0.b.f5330m, 0), r0.a.b(context, l0.b.f5328k, 0), context.getResources().getDisplayMetrics().density);
    }

    private boolean e(int i3) {
        return androidx.core.graphics.a.j(i3, 255) == this.f5859d;
    }

    public float a(float f3) {
        if (this.f5860e <= 0.0f || f3 <= 0.0f) {
            return 0.0f;
        }
        return Math.min(((((float) Math.log1p(f3 / r2)) * 4.5f) + 2.0f) / 100.0f, 1.0f);
    }

    public int b(int i3, float f3) {
        int i4;
        float fA = a(f3);
        int iAlpha = Color.alpha(i3);
        int iH = r0.a.h(androidx.core.graphics.a.j(i3, 255), this.f5857b, fA);
        if (fA > 0.0f && (i4 = this.f5858c) != 0) {
            iH = r0.a.g(iH, androidx.core.graphics.a.j(i4, f5855f));
        }
        return androidx.core.graphics.a.j(iH, iAlpha);
    }

    public int c(int i3, float f3) {
        return (this.f5856a && e(i3)) ? b(i3, f3) : i3;
    }

    public boolean d() {
        return this.f5856a;
    }

    public a(boolean z2, int i3, int i4, int i5, float f3) {
        this.f5856a = z2;
        this.f5857b = i3;
        this.f5858c = i4;
        this.f5859d = i5;
        this.f5860e = f3;
    }
}
