Get color between 2 colors
I have color A and color B. I want to get color C that's between the other two (it can be in the middle, or in any point I need). For example, Color C can be at 10% from A and 90% from B. Or 50% from A and 50% from B. Is there a way to do this?
NOTE. Color.Lerp fades from one color to another in a given time. I need to get some color in the middle, not this.
how is that different from Color.Lerp? Sorry if I misunderstood.
colorC = Color.Lerp(colorA, colorB, 0.1f) // Color C is 10% from A and 90% from B.
colorC = Color.Lerp(colorA, colorB, 0.5f) // Color C is 50% from A and 50% from B.
True. Lerping doesn't have to be over time. In essense, it just returns a value between two other value. So, a value of 0.5 would return the color that's midway between a and b.
Sigh... Lerp... the most misunderstood methods of the Unity API. Sometimes i feel like i just want to give a big group hug to Color.Lerp, Vector3.Lerp and their little brother $$anonymous$$athf.Lerp... :)
Your answer
Follow this Question
Related Questions
Why Color.Lerp or Color32.Lerp doesnt work properly? 1 Answer
Sprite image on UI appears much darker than actual image file. Please help! 1 Answer
How Do I Import A model with Colors? 0 Answers
How to gradually change color of sprite during runtime 0 Answers
How to animate fog color over time for day night cycle 1 Answer