Is any Maths for making a (simple) color gradient?
I’m looking for simple methods of making a gradient.
Not in a specific language. Just the maths of colors.
Is any Maths for making a (simple) color gradient? I’m looking for simple methods
Share
In general, a colour gradient is a linear function for easing from one colour to another. For instance, if you wanted to produce a gradient from red (100%, 0%, 0%) to blue (0%, 0%, 100%), you would sweep each colour value from its initial value to its target value.
At the middle of the gradient, the colour value would be equal to 50% of the first colour, added to 50% of the second colour. In this example, you’d end up with (50%, 0%, 50%) – which is equal to purple.