Description
When attempting to change the color of a drawable that is on top of a dark background, I ran into an issue where the color would be slightly changed.
In the image below, you will see that the top view that has a white background has a dark blueish icon color, but the view below which is on top of a dark background has a light blueish color.
The drawable colors should be consistent regardless of the background color of the containing view.
Code
ImageView fairInfoEmailImageView = (ImageView) getView().findViewById(R.id.fairInfoEmailImageView);
fairInfoEmailImageView.setColorFilter(dashboardIconColor, PorterDuff.Mode.MULTIPLY);
ImageView fairInfoSurveyImageView = (ImageView) getView().findViewById(R.id.fairInfoSurveyImageView);
fairInfoSurveyImageView.setColorFilter(dashboardIconColor, PorterDuff.Mode.MULTIPLY);
Note*: The below image is implemented by both the ImageView's drawables being white and then applying a MULTIPLY color filter with the overridden color.
Attempts
- Attempted ColorFilters, Tints, etc, but I believe these are bringing the background color into the equation.
Question
Is there a way to dynamically change the color of a drawable without the use of a ColorFilter?
Feel free to ask for more code or any questions about the problem.