Assets color value

The new assets methods are really great but… what is that value for colors?

For example, trying to retrieve a #FF0000 from the Assets Panel:

let allColorsA = assets.colors.get();
let firstColor = allColorsA[0].color.value;
console.log(firstColor); // output: 4294901760

Color.value gives you the entire color in 32-bit ARGB format – 4294901760 is 0xFFFF0000. Looks like this got left out of the docs, which I’ll work on correcting.

It may be easier to work with the piecewise properties like Color.a, Color.r, etc. Those are covered in the docs already: https://adobexdplatform.com/plugin-docs/reference/Color.html.

2 Likes

Thank you very much @peterflynn.

In fact, changed to:

let allColorsA = assets.colors.get();
let firstColor = allColorsA[0].color;
console.log(firstColor.r); // output: 255
1 Like