How can I change the color of a template by injecting the desired color through msg.payload?

the layout is:

inject -> http request -> funktion -> template

I want the color to change based on whether it is connected or not. But no matter what I try, I am not able to "inject" a color into the template. Please help me figure out a way to do this. I am not proficient in coding and have mostly been using AI to write my code. Thank you in advance.

funktion:

const html = msg.payload || "";
const normalizedHtml = html.toUpperCase();

if (normalizedHtml.includes("RUN")) {
    msg.color = "#3FADB5";
    msg.text = "Connected";
} else {
    msg.color = "yellow";
    msg.text = "No connection";
}
return msg;

template:

the rest (injector and http request) are working as intended

Welcome to the forum @Overpago

No doubt you have discovered that you can include msg.text in the template content using 'mustaches', eg

<p>{{msg.text}}</p>

The syntax for styling an element <div style = "yellow"> ... is different.
Try

<div :style="{'background-color' : msg.color}">

Note the colon before 'style'.

Welcome. You may need to specify that the template is for Dashboard 2 if using AI as ng-style I think is Dashboard (1).