Getting RGBA colour from gutenberg colourpicker

I’m working on a block that has it’s own colour picker. This is working fine and I can see my background colour changing however I’m only able to get the hex value for the colour.

I’m changing the colour as it stands by doing:-

style={{ backgroundColor: `${tint.hex}` }}

Tint is an object returned from the colour picker and I can see that it has a sub object called color that contains rgba values.

How do I get these values and make the backgroundColour use rgba()?

Read more here:: Getting RGBA colour from gutenberg colourpicker

Leave a Reply

Your email address will not be published. Required fields are marked *