I have a shape like this:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="1dp"
android:color="#d5dce5" />
<corners android:radius="5dp" />
<gradient
android:angle="270"
android:centerColor="#e7eff8"
android:endColor="#e9f0f8"
android:startColor="#e0e8f1" />
</shape>
Which I include in my layout like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
....
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rectangle"
android:layout_width="276dp"
android:layout_height="wrap_content"
android:background="@drawable/rectangle"
android:layout_gravity="center_horizontal">
</LinearLayout>
....
</LinearLayout>
How can I set the opacity of this shape to 50 % ? Is it possible?
This is how hex colors work:
So lets take your center color: android:centerColor=”#e7eff8″
50 % of FF = 7F.
End results = #7fe7eff8″