You can try something like this:
let coloredTexts = [
{value: "full", color: "red"},
{value: "free", color: "green"},
{value: "half-full", color: "#000000"}
];
$w.onReady(() => {
$w("#dataset1").onReady(() => {
const textValue = $w("text1").text;
const colorObj = coloredTexts.find(e => e.value === textValue );
if(colorObj){
$w("text1").html = $w("text1").html.replace(">", ` style="color:${colorObj.color}">`);
}
})
})