How Can I Pass A Hex Code For Background Colour Via A Query Parameter?

I want to pass a query parameter to a page to specify hex colour code to be used as the background colour for various items on the page. It is a booking form I want my users to be able to customise.

So the page will be called as something like:

form.php?bg=f8f8f8

Having passed the query parameter, what would be the best way to apply it as the background colour to an element? :thinking:

Should I just apply an inline style? I’m experimenting with that as a dmx-style parameter but it isn’t working so well…

Is dmx-style supported?

This doesn’t work:
(just using a variable for now rather than a query param):

<dmx-value id="bg_color" dmx-bind:value="'ff0000'"></dmx-value>
<div class="container p-3 b_right2 rc_20 mt-5 container_section shadow" id="c_contact" dmx-show="form_mode.value=='event'" dmx-style="'background-color:#'+bg_color.value+' !important;'">

But I know the inline style itself is working:

<dmx-value id="bg_color" dmx-bind:value="'ff0000'"></dmx-value>
<div class="container p-3 b_right2 rc_20 mt-5 container_section shadow" id="c_contact" dmx-show="form_mode.value=='event'" style="background-color:#ff0000 !important;">
Community Page
Last updated: