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

Certain option values throw errors #1

Closed
astanciu opened this issue Oct 10, 2015 · 10 comments
Closed

Certain option values throw errors #1

astanciu opened this issue Oct 10, 2015 · 10 comments

Comments

@astanciu
Copy link

This throws an error:
var pallet = DistinctColors({count:50, lightMin: 50})
TypeError: Reduce of empty array with no initial value

If lightMin is less than 50, it works. I also see it in other random places, for example if hueMin is 300.

@internalfx
Copy link
Owner

@astanciu Thanks for the bug report.

var pallet = DistinctColors({count:50, lightMin: 50, samples: 10000})

Does that work?

@astanciu
Copy link
Author

It got lightMin of 50 to work, but it was extremely slow. I then tried lightMin at 80 and got the same error.

@astanciu
Copy link
Author

There's really strange stuff going on. lightMin: 55, lightMax 77, for ex, work. Pretty much the same for the other values, certain ranges work

@internalfx
Copy link
Owner

Thanks, I think I have an idea what's going on.

@internalfx
Copy link
Owner

I'm going to write a test suite for this.

@internalfx
Copy link
Owner

@astanciu grab v1.0.2 should work much better. I wont say the problem is totally resolved yet though.

However, if a setting works once, it should work everytime. Also, it wont error out anymore. but you could get duplicate colors.

@internalfx
Copy link
Owner

Found the real issue... closing in favor of #2

@internalfx
Copy link
Owner

@astanciu please try the latest 1.0.4 problem should be solved for good now.

@owickstrom
Copy link

owickstrom commented Jan 13, 2017

Hi!

I got the same error with lightMin: 20 using version 1.0.4. lightMin: 25 works.

@internalfx
Copy link
Owner

@owickstrom Same exact error message?

TypeError: Reduce of empty array with no initial value

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

No branches or pull requests

3 participants