diff --git a/src/color/p5.Color.js b/src/color/p5.Color.js index 84d27f26f2..0df96a4abd 100644 --- a/src/color/p5.Color.js +++ b/src/color/p5.Color.js @@ -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; diff --git a/src/shape/custom_shapes.js b/src/shape/custom_shapes.js index ce718f9f3c..60cf5cd9e2 100644 --- a/src/shape/custom_shapes.js +++ b/src/shape/custom_shapes.js @@ -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); } }