package X6FRs_4.IMuAHx_6.IFxWkV_5;

import android.graphics.Color;
/* compiled from: ColorUtils.java */
/* loaded from: classes.dex */
public final class KQgRr5e_0 {
    static {
        new ThreadLocal();
    }

    public static int KQgRr5e_0(int i, int i2) {
        return 255 - (((255 - i2) * (255 - i)) / 255);
    }

    public static int PGPF6hQ_2(int i, int i2) {
        if (i2 < 0 || i2 > 255) {
            throw new IllegalArgumentException("alpha must be between 0 and 255.");
        }
        return (i & 16777215) | (i2 << 24);
    }

    public static int QxJ9d_1(int i, int i2) {
        int alpha = Color.alpha(i2);
        int alpha2 = Color.alpha(i);
        int KQgRr5e_0 = KQgRr5e_0(alpha2, alpha);
        return Color.argb(KQgRr5e_0, KQgRr5e_0(Color.red(i), alpha2, Color.red(i2), alpha, KQgRr5e_0), KQgRr5e_0(Color.green(i), alpha2, Color.green(i2), alpha, KQgRr5e_0), KQgRr5e_0(Color.blue(i), alpha2, Color.blue(i2), alpha, KQgRr5e_0));
    }

    public static int KQgRr5e_0(int i, int i2, int i3, int i4, int i5) {
        if (i5 == 0) {
            return 0;
        }
        return (((i * 255) * i2) + ((i3 * i4) * (255 - i2))) / (i5 * 255);
    }
}
