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

Seed option is broken #13

Closed
Discordius opened this issue Sep 7, 2020 · 1 comment
Closed

Seed option is broken #13

Discordius opened this issue Sep 7, 2020 · 1 comment

Comments

@Discordius
Copy link
Contributor

Discordius commented Sep 7, 2020

When I try to call the line TinyColor.random(~seed="sdf", ()), or any other seed, the output crashes for me with the stacktrace:

TinyColor.bs.js:1330 Uncaught Error: Color not found
    at getColorInfo (TinyColor.bs.js:1330)
    at pickSaturation (TinyColor.bs.js:1249)
    at random (TinyColor.bs.js:1222)
    at Module.random$1 (TinyColor.bs.js:1958)
@Discordius
Copy link
Contributor Author

It appears to be fixed if instead of passing it a string as a seed option, you instead pass it a number. Indeed in the internal Typescript code of TinyColor, it is assumed to be a number: https://github.com/scttcper/tinycolor/blob/master/src/random.ts#L7

Discordius added a commit to Discordius/bs-tinycolor that referenced this issue Sep 7, 2020
Related to mikaello#13, this replaced the type signature of seed with int to make it align with the type signature of the TinyColor seed.
mikaello pushed a commit that referenced this issue Sep 7, 2020
mikaello pushed a commit to Discordius/bs-tinycolor that referenced this issue Sep 7, 2020
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

1 participant