Can you help me modify a function to display different colors based on the output? For instance, I want it to show in orange if the result is too low, and in red if it indicates obesity.
bmiCalculation() {
var weight = parseInt(this.currentWeight);
var height = parseInt(this.height) / 100;
var bmi = weight / (height * height);
let text = "";
if (bmi < 18.5) {
text = bmi.toFixed(2) + "kg/m2" + " Too low :)";
} else if (bmi >= 18.5 && bmi < 24.9) {
text = bmi.toFixed(2) + "kg/m2" + " Normal";
} else if (bmi >= 25 && bmi < 29.9) {
text = bmi.toFixed(2) + "kg/m2" + " Too much";
} else if (bmi > 30) {
text = bmi.toFixed(2) + "kg/m2" + " Obese";
}
return text;
}