beginner here. I had a question about color coding the result of a function. The code I have below tells me the range of the last three values in my array. What I'd like to do is color code the output. So if the range is <=0.10
then the font would be red, or if it's >0.10
, then the font would be green. Is there a simple way to do this? I am using this script for an ArcGIS Survey123 form.
Thanks.
function ph(invals) {
if (Array.isArray(invals) && invals.length > 2) {
var phlastthree = invals.slice(Math.max(invals.length - 3, 0));
var max = Math.max(...phlastthree);
var min = Math.min(...phlastthree);
var result = max-min
return result.toFixed(2);
}
return null;
}