Gradually change color

So I have a Heart Pulse sensor, and I want the color to gradually change after each 5 BPM Increments. So far I have it changing abruptly. How do I change it gradually, like a fade?

if (avgBPM < 55){ tint(255, 255, 255, 200); } } else if ((avgBPM > 55) && (avgBPM < 60)){ tint(215, 255, 255, 200); } } else if ((avgBPM > 60) && (avgBPM < 65)){ tint(175, 255, 255, 200); } } else if ((avgBPM > 65) && (avgBPM < 70)){ tint(135, 255, 255, 200); } else if ((avgBPM > 70) && (avgBPM < 75)){ tint(95, 255, 255, 200); } else if ((avgBPM > 75) && (avgBPM < 80)){ tint(55, 255, 0, 200); }

Tagged:

Answers

Sign In or Register to comment.