I’m trying to change the color of each circle depending on the magnitude. However, they all remain blue.
This is the assignment:
- Determine what color the circle for this earthquake should be:
- If the magnitude is less than 6.3, the color should be (0, 0, 255)
- If the magnitude is between 6.3 (including 6.3) up to but NOT including 7.0 (i.e. greater than or equal to 6.3 but strictly less than 7.0), the color should be (155, 0, 100)
- If the magnitude is between 7.0 (including 7.0) up to but NOT including 7.5, the color should be (200, 0, 55)
- Otherwise, the color should be (255, 0, 0)
And this is the code that I have so far:
float varM = getMag(datum);
if (varM < 6.3) {
color(0,0,255);
};
if (6.3 >= varM && varM < 7.0) {
color(155,0,100);
};
if (7.0 <= varM && varM < 7.5) {
color(255,0,55);
};