The default Android image studio only lets me choose 1 color as the background for my icon. Is there a way to choose 2 and create a linear gradient effect?
Create an color_gradient.xml in drawable:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="@color/start_gradient" <!--Start color of the gradient-->
android:endColor="@color/end_gradient" <!--End color of the gradient-->
android:angle="45" /> <!--Change this to see the combination of gradient color-->
</shape>
</item>
</selector>
When using for your image:
android:backgroundTint="@drawable/color_gradient
EDIT:
In case of using Android Image Asset, you still can link the background color to this xml file, to create a gradient background
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With