I have one color, for example 0xFF0000. I want to create simple gradient using only this color as start-point information. The second point will be lighter color the first color.
For example if I have value – 0xFF0000 and I want to get 0xCC0000 from it. Then I can draw simple gradient.
so second color should be, for example 10 or 20% lighter then first
Hard code values are not acceptable. User will select the color from the color wheel and application should automatically generate the second color to draw simple gradient.
Is there any algorithm or way to to implement this?
Probably algorithm will count what higher: R or G or B and then parallel decrease other components, or something… I’m not sure how this works.
P.S.: I’m using android SDK
I think the best is converting from the RGB to the HSV space:
then you can enlight a color simply by incrementing the
v(value) component, and then converting back to RGB if needed with the very same Android APIColor