I am trying to change the opacity of the color that I get from my theme with the following code:
TypedValue typedValueDrawerSelected = new TypedValue(); getTheme().resolveAttribute(R.attr.colorPrimary, typedValueDrawerSelected, true); int colorDrawerItemSelected = typedValueDrawerSelected.data;
I want colorDrawerItemSelected keep the same color, but its alpha value should be 25%.
I found some solutions getting rgb color from imageView, but I don't have an image.
Thank you for your time.
java android int transparency alpha
Dahnark
source share