compat/src/main/java/androidx/core/graphics/ColorUtils.java
@ColorInt
    public static int blendARGB(@ColorInt int color1, @ColorInt int color2,
            @FloatRange(from = 0.0, to = 1.0) float ratio) {
        final float inverseRatio = 1 - ratio;
        float a = Color.alpha(color1) * inverseRatio + Color.alpha(color2) * ratio;
        float r = Color.red(color1) * inverseRatio + Color.red(color2) * ratio;
        float g = Color.green(color1) * inverseRatio + Color.green(color2) * ratio;
        float b = Color.blue(color1) * inverseRatio + Color.blue(color2) * ratio;
        return Color.argb((int) a, (int) r, (int) g, (int) b);
    }
/**
     * Blend between two ARGB colors using the given ratio.
     *
     * <p>A blend ratio of 0.0 will result in {@code color1}, 0.5 will give an even blend,
     * 1.0 will result in {@code color2}.</p>
     *
     * @param color1 the first ARGB color
     * @param color2 the second ARGB color
     * @param ratio  the blend ratio of {@code color1} to {@code color2}
     */
Blend between two ARGB colors using the given ratio.
A blend ratio of 0.0 will result in  color1, 0.5 will give an even blend,
1.0 will result in  color2.

@param color1 the first ARGB color
@param color2 the second ARGB color
@param ratio  the blend ratio of  color1 to  color2
Blend between two ARGB colors using the given ratio . A blend ratio of 0 . 0 will result in color1 0 . 5 will give an even blend 1 . 0 will result in color2 . @param color1 the first ARGB color @param color2 the second ARGB color @param ratio the blend ratio of color1 to color2
@ColorInt
    public static int blendARGB(@ColorInt int color1, @ColorInt int color2,
            @FloatRange(from = 0.0, to = 1.0) float ratio) {
        final float inverseRatio = 1 - ratio;
        float a = Color.alpha(color1) * inverseRatio + Color.alpha(color2) * ratio;
        float r = Color.red(color1) * inverseRatio + Color.red(color2) * ratio;
        float g = Color.green(color1) * inverseRatio + Color.green(color2) * ratio;
        float b = Color.blue(color1) * inverseRatio + Color.blue(color2) * ratio;
        return Color.argb((int) a, (int) r, (int) g, (int) b);
    }
@ ColorInt public static int blendARGB ( @ ColorInt int color1 , @ ColorInt int color2 , @ FloatRange ( from = 0.0 , to = 1.0 ) float ratio ) { final float inverseRatio = 1 - ratio ; float a = Color . alpha ( color1 ) * inverseRatio + Color . alpha ( color2 ) * ratio ; float r = Color . red ( color1 ) * inverseRatio + Color . red ( color2 ) * ratio ; float g = Color . green ( color1 ) * inverseRatio + Color . green ( color2 ) * ratio ; float b = Color . blue ( color1 ) * inverseRatio + Color . blue ( color2 ) * ratio ; return Color . argb ( ( int ) a , ( int ) r , ( int ) g , ( int ) b ) ; }
Blend between two ARGB colors using the given ratio.
Blend between two ARGB colors using the given ratio .