I'm trying to create an array of color values. I define the color values as objects:
let rgbPalette = [];
var color1 = {r: 152, g: 52, b: 211, a: 255};
rgbPalette.push(color1);
var color2 = {r: 0, g: 0, b: 0, a: 0};
rgbPalette.push(color2);
console.log(rgbPalette);
when log the array to the console, i get different property values of the objects:
rgbPalette:
(2) [{…}, {…}]
0: {r: 151, g: 51, b: 210, a: 255}
1: {r: 0, g: 0, b: 0, a: 8}
length: 2
__proto__: Array(0)
Can anyone help me figure out what is going on here? Thanks.