Name |
lerpColor()线性颜色 |
||||||||
Examples |
stroke(255); background(51); color from = color(204, 102, 0); color to = color(0, 102, 153); color interA = lerpColor(from, to, .33); color interB = lerpColor(from, to, .66); fill(from); rect(10, 20, 20, 60); fill(interA); rect(30, 20, 20, 60); fill(interB); rect(50, 20, 20, 60); fill(to); rect(70, 20, 20, 60); |
||||||||
Description |
Calculates a color or colors between two color at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is halfway in between, etc. 在特定增量中计算两种颜色之间的颜色或颜色。amt 参数是在两个值之间插补的量, 其中0.0 等于第一个点, 0.1 是非常接近第一点, 0.5 是介于中间, 等等。 低于0的金额将被视为0。同样, 1 以上的金额将封顶1。这与 lerp () 的行为不同, 但有必要, 因为在范围之外的数字会产生奇怪的和意想不到的颜色。 |
||||||||
Syntax |
lerpColor(c1, c2, amt) |
||||||||
Parameters |
|
||||||||
Returns |
int |
||||||||
Related |
color() |
- 本文固定链接: http://iprocessing.cn/2017/08/08/lerpcolor线性颜色/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表