Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generatePalette is wrong #2112

Closed
CymricNPG opened this issue Jun 22, 2019 · 1 comment
Closed

generatePalette is wrong #2112

CymricNPG opened this issue Jun 22, 2019 · 1 comment

Comments

@CymricNPG
Copy link

CymricNPG commented Jun 22, 2019

public Palette generatePalette(int colorCount, Preset preset) {

The code makes no sense:

 public Palette generatePalette(int colorCount, Preset preset) {
    int quality = 50;
    if (colorCount > 50) {
        quality = 25;
    } else if (colorCount > 100) {
        quality = 10;
    } else if (colorCount > 200) {
        quality = 5;
    } else if (colorCount > 300) {
        quality = 2;
    }

I think it should be:

var quality = 50
if (colorCount > 300) {
    quality = 2
} else if (colorCount > 200) {
    quality = 5
} else if (colorCount > 100) {
    quality = 10
} else if (colorCount > 50) {
    quality = 25
}
@mbastian mbastian added this to the 0.9.3 milestone Oct 24, 2021
@mbastian mbastian mentioned this issue Oct 25, 2021
@mbastian
Copy link
Member

mbastian commented Dec 2, 2021

This was fixed in #2363, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants