MCPcopy Create free account
hub / github.com/benfry/processing4 / lerpColor

Method lerpColor

core/src/processing/core/PApplet.java:9631–9637  ·  view source on GitHub ↗

Calculates a new color that is a blend of two other colors. The amt parameter controls the amount of each color to use where an amount of 0.0 will produce the first color, 1.0 will return the second color, and 0.5 is halfway in between. Values between 0.0 and 1.0 will interpolate betwe

(int c1, int c2, float amt)

Source from the content-addressed store, hash-verified

9629 * @see PApplet#lerp(float, float, float)
9630 */
9631 public int lerpColor(int c1, int c2, float amt) {
9632 if (g != null) {
9633 return g.lerpColor(c1, c2, amt);
9634 }
9635 // use the default mode (RGB) if lerpColor is called before setup()
9636 return PGraphics.lerpColor(c1, c2, amt, RGB);
9637 }
9638
9639
9640 static public int blendColor(int c1, int c2, int mode) {

Callers 1

makeGradientRGBMethod · 0.95

Calls 1

lerpColorMethod · 0.95

Tested by

no test coverage detected