是否有任何用于制作(简单)颜色渐变的数学? 我正在寻找一个简单的梯度方法。 不是特定的语言。只是数学的颜色。
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.
推荐答案一般来说,颜色渐变是一种线性函数,例如,如果要生成从红色(100%,0%,0%)到蓝色(0%,0%,100%)的渐变,则可以将每个颜色值从其初始值扫描到其目标值。
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.
在渐变的中间,颜色值将等于第一种颜色的50%,添加到第二种颜色的50%。在此示例中,您最终会显示(50%,0%,50%) - 等于紫色。
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.
更多推荐
颜色渐变的数学
发布评论