@Override
    protected void onColorChange(int color) {
        super.onColorChange(color);
        final int preAlpha = Color.alpha(color);
        mBackgroundAlpha = (Ui.modulateAlpha(preAlpha, 128));

        if (preAlpha < 255) {
            mRippleAlpha = getRippleAlpha(preAlpha, mBackgroundAlpha);
        } else {
            mRippleAlpha = preAlpha;
        }
    }
This is a touch foreground ripple drawable extends to StatePaintDrawable
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/AlmostRippleDrawable.java