Skip to content

Commit

Permalink
added this.
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomGamingDev committed Apr 11, 2024
1 parent 7f99565 commit 6a06a20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/color/creating_reading.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ p5.prototype.lerpColor = function(c1, c2, amt) {
*
* function draw() {
* // This example goes from red to yellow and then to green
* const palette = [color("red"), color("yellow"), color("green")];
* const palette = [color('red'), color('yellow'), color('green')];
* const lerp_color = paletteLerp(palette, (millis() / 2000) % 1);
* background(lerp_color);
* }
Expand All @@ -1112,7 +1112,7 @@ p5.prototype.paletteLerp = function(colors, amt) {

const from = colors[from_index];
const to = colors[from_index + 1];
return lerpColor(from, to, amt * last_color_ind - from_index);
return this.lerpColor(from, to, amt * last_color_ind - from_index);
};

/**
Expand Down

0 comments on commit 6a06a20

Please sign in to comment.