public static void applyToOrTransparent ( ColorHolder colorHolder , Context ctx , GradientDrawable gradientDrawable ) { if ( colorHolder != null && gradientDrawable != null ) { colorHolder . applyTo ( ctx , gradientDrawable ) ; } else if ( gradientDrawable != null ) { gradientDrawable . setColor ( Color . TRANSPARENT ) ; } }
a small static helper to set the color to a GradientDrawable null save