Skip to content

Values with the highest colors are displayed white #2

@geisterdach

Description

@geisterdach

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions