I have an Android app with a dynamically updating percentage (between 0 and 100). The app has two specific colors – light red (#BD4141) and light green (#719D98).
I would like an element to have the light red color background when the given percentage is 0 and light green when it’s 100. Intermediary percentage should represent a soft transition color representation between these two colors.
Alternatively, I would like it to go from solid red to solid green.
This code is not optimized but it does what it is meant to do.
This answer is based on question and answers from android color between two colors, based on percentage?.