If i defined a color in resources
#123456
it\'s possible
If you don't want to use ContextCompat or SuppressLint, simply add a string resource right under your color.
Instead of
#FFFFFF
Use
#FFFFFF
#FFFFFF
Your code does get more repetitive but it's much cleaner. Besides, forgeting to updating the string after changing color is almost impossible since they are right next to each other.