-
Notifications
You must be signed in to change notification settings - Fork 7
Values with the highest colors are displayed white #2
Copy link
Copy link
Open
Description
I have changed this:
for (int i = 1; i < numberOfColorClasses; i++) {
if (value <= min + (i * classSize)) {
return colorPalette[i];
} else if (value > (classSize * i) && i == numberOfColorClasses - 1) {
return colorPalette.last;
}
}
to this:
for (int i = 1; i < numberOfColorClasses; i++) {
if (value <= min + (i * classSize)) {
return colorPalette[i];
} else if (value > min + (classSize * i) &&
i == numberOfColorClasses - 1) {
return colorPalette.last;
}
}
I think this makes more sense. I think what you are trying to do is that if in the last iteration still nothing is returned, then you just return the last value. Probably you also just write ¨else if (i == numberOfColorClasses - 1) ¨ because the first condition must be true anyway, in case the previous IF does not catch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels