package k2;

import android.graphics.Color;
import java.util.Arrays;
import z1.AbstractC3294a;

/* JADX INFO: renamed from: k2.d, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2378d {

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

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

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f19762f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f19763g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f19764h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public float[] f19765i;

    public C2378d(int i6, int i7) {
        this.f19757a = Color.red(i6);
        this.f19758b = Color.green(i6);
        this.f19759c = Color.blue(i6);
        this.f19760d = i6;
        this.f19761e = i7;
    }

    public final void a() {
        if (this.f19762f) {
            return;
        }
        int i6 = this.f19760d;
        int iE = AbstractC3294a.e(4.5f, -1, i6);
        int iE2 = AbstractC3294a.e(3.0f, -1, i6);
        if (iE != -1 && iE2 != -1) {
            this.f19764h = AbstractC3294a.g(-1, iE);
            this.f19763g = AbstractC3294a.g(-1, iE2);
            this.f19762f = true;
            return;
        }
        int iE3 = AbstractC3294a.e(4.5f, -16777216, i6);
        int iE4 = AbstractC3294a.e(3.0f, -16777216, i6);
        if (iE3 == -1 || iE4 == -1) {
            this.f19764h = iE != -1 ? AbstractC3294a.g(-1, iE) : AbstractC3294a.g(-16777216, iE3);
            this.f19763g = iE2 != -1 ? AbstractC3294a.g(-1, iE2) : AbstractC3294a.g(-16777216, iE4);
            this.f19762f = true;
        } else {
            this.f19764h = AbstractC3294a.g(-16777216, iE3);
            this.f19763g = AbstractC3294a.g(-16777216, iE4);
            this.f19762f = true;
        }
    }

    public final float[] b() {
        if (this.f19765i == null) {
            this.f19765i = new float[3];
        }
        AbstractC3294a.a(this.f19757a, this.f19758b, this.f19759c, this.f19765i);
        return this.f19765i;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && C2378d.class == obj.getClass()) {
            C2378d c2378d = (C2378d) obj;
            if (this.f19761e == c2378d.f19761e && this.f19760d == c2378d.f19760d) {
                return true;
            }
        }
        return false;
    }

    public final int hashCode() {
        return (this.f19760d * 31) + this.f19761e;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder(C2378d.class.getSimpleName());
        sb.append(" [RGB: #");
        sb.append(Integer.toHexString(this.f19760d));
        sb.append("] [HSL: ");
        sb.append(Arrays.toString(b()));
        sb.append("] [Population: ");
        sb.append(this.f19761e);
        sb.append("] [Title Text: #");
        a();
        sb.append(Integer.toHexString(this.f19763g));
        sb.append("] [Body Text: #");
        a();
        sb.append(Integer.toHexString(this.f19764h));
        sb.append(']');
        return sb.toString();
    }
}
