I'm trying to compare whether the background color of one of my views is equal to a color resource I created and haven't found anything that works.
I'm willing to use any method, whether converting to HEX or String or Int, as long as it works. Here's an example of my current method.
I set the background color of a view with:
ColorDrawable chosenColorBox = (ColorDrawable) chosenColor.getBackground();
int colorId = chosenColorBox.getColor();
colorId == `-611329`
Try to compare the color to
Context.getResources().getColor(R.color.tag_pink) instead of the resource's ID (which is not the color!). The returned value represents the color in the form of