public void applyWithAlpha(int alpha, Paint paint) {
    int finalAlpha = Utils.mixOpacities(Color.alpha(color), MiscUtils.clamp(alpha, 0, 255));
    if (finalAlpha > 0) {
      int newColor = Color.argb(finalAlpha, Color.red(color), Color.green(color), Color.blue(color));
      // Paint.setShadowLayer() removes the shadow if radius is 0, so we use a small nonzero value in that case
      paint.setShadowLayer(Math.max(radius, Float.MIN_VALUE), dx, dy, newColor);
    } else {
      paint.clearShadowLayer();
    }
  }
Applies a shadow to the provided Paint object, mixing its alpha by the provided value.
lottie/src/main/java/com/airbnb/lottie/utils/DropShadow.java