Dynamic background colour for a product based on metafield

Hey @made4Uo

I have a similar question about a Marquee or Announcement Bar. I am using Baseline theme.

I want to change the color of the announcement bar at the top, and subscribe bar at the bottom of the product page dynamically. The color would be based on a metafield for each product called product_background_color.

Can someone you help me with the code and where to place it to achieve this? I’m not sure if its in the product.liquid or announcement-bar.liquid.