if heartRate >= 0 <= 79 color red
if heartRate >= 80 <=119 color yellow
If heartRate >= 120 <= 150 color green
If heartRate >= 151 <= 170 color orange
If heartRate >= 181 color red
using UnityEngine;
using System.Collections;
public class heartrate : MonoBehaviour {
Color[] heart_colors = { Color.black, Color.blue, Color.cyan, Color.gray, Color.green, Color.red, Color.magenta, Color.white, Color.yellow, new Color (255,0,0,255) };
int heartrateC = 50;
int color_index = heartrateC /10;
renderer.material.color = heart_colors [color_index];