If you want different color depending on values that will be very sensor specific, and out of scope of my simple script. I suggest adding a function by yourself that take care of that. Similar to how I did with sensor type for moisture, you should be able to apply the same principle to text color.
FWIW: I’ve used data URIs with base64 encoded PNGs to show images in scriptable widgets. See eg. data URI scheme - Wikipedia for more information. Basically convert your image to a data URI (there are many free online services to do this), then
let req = new Request('data:image/png;base64,....')
someStack.addImage(req.loadImage())