I am trying to use several transparent color options of my accent in my xml (10%, 50%, ... etc.).
An example of my current code:
<color name="colorAccent">#FF0000</color>
<color name="colorAccent10Percent">#1AFF0000</color>
<color name="colorAccent50Percent">#80FF0000</color>
I was wondering if there is an easier way than setting a new color for each transparency, so that whenever I change the color accent, all dependent colors will change automatically. This is what I tried, but it did not work:
<color name="colorAccent">#FF0000</color>
<color name="colorAccent10Percent" alpha="0.1">@color/colorAccent</color>
<color name="colorAccent50Percent" alpha="0.5">@color/colorAccent</color>
Changing alpha views is not an option.
source
share