0

I have these variables in colors.xml

<color name="white1">#FFFFFF</color> <!-- 100% of transparency -->
<color name="white2">#BFFFFFFF</color> <!-- 75% of transparency -->
<color name="white3">#80FFFFFF</color> <!-- 50% of transparency -->
<color name="white4">#40FFFFFF</color> <!-- 25% of transparency -->
<color name="white5">#00FFFFFF</color> <!-- 0% of transparency -->

Is there any way to pass transparency via parameters such as strings.xml in this topic or another way instead of make many variables

Taha Sami
  • 1,565
  • 1
  • 16
  • 43
  • as far as i know no you can't. you can set a color programtically and you can also set alpha to view dynamically – Raghunandan Jun 26 '21 at 14:52
  • @Raghunandan I'm using this view `com.google.android.material.slider.Slider` and this view has many attributes relating colors and if I set `android:alpha="0.25"` this will apply to the whole view. I wish my English is clear to understand. – Taha Sami Jun 26 '21 at 15:07
  • you need to have those colors in colors.xml – Raghunandan Jun 26 '21 at 16:00
  • I thought there is a better way of that, By the way thank you. – Taha Sami Jun 26 '21 at 16:46

0 Answers0