Before asking my question, let me clarify 2 things first:
- I am developing an Android app
- I do not need nor want to draw the gradient. I just want to know the color.
Question
I have 2 colors, let's name them startColor
and endColor
.
Now please imagine a linear gradient line from startColor
to endColor
.
Let's say I have a float 0.3f
.
I want to know at the 30% position, from start to end, the color at the gradient.
How can I do this?
Things I have tried
- Java awt library's
GradientPaint
- It is not available in Android context; - android.graphics.LinearGradient - The best I can do is to get a
Matrix
from this gradient, but then I don't know what to do next.