Skip to content

Commit

Permalink
Fix some compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
limzykenneth committed Dec 15, 2024
1 parent d058101 commit 890c5ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/color/p5.Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class Color {
return [...this._color.coords, this._color.alpha];
}

array(){
return this._array;
}

lerp(color, amt, mode){
// Find the closest common ancestor color space
let spaceIndex = -1;
Expand Down
8 changes: 3 additions & 5 deletions src/shape/custom_shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,17 +650,15 @@ class Shape {
} else if (original instanceof Vector) {
return new Vector(queue.shift(), queue.shift(), queue.shift());
} else if (original instanceof Color) {
// NOTE: Not sure what intention here is, `Color` constructor signature
// has changed so needed to be reviewed
const array = [
queue.shift(),
queue.shift(),
queue.shift(),
queue.shift()
];
return new Color(
array.map((v, i) => v * original.maxes[original.mode][i]),
original.mode,
original.maxes
);
return new Color(original);
}
}

Expand Down

0 comments on commit 890c5ce

Please sign in to comment.