I’m currently working on a project which requires me to dynamically set the color of certain UI elements to random RGB values.
Unfortunately and surprisingly, handy methods for dealing with colors in Android are only available since API level 26 (Android O). Luckily though, the developer reference specifies, how colors are encoded internally in the Android operating system, so I was able to create a class with the most important color-related (for my use-case) methods which is able to function in lower Android versions as well.
I hope I can save some of you from headaches by sharing the code. Feel free to reuse as you please 🙂
PS: Is there a way to create Github-like gists with Gitea?
One response to “Dealing with Colors in lower Android versions”
[…] Dealing with Colors in lower Android versions […]