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

Invalid value input is not handled properly #239

Open
headwindz opened this issue Jan 13, 2022 · 2 comments
Open

Invalid value input is not handled properly #239

headwindz opened this issue Jan 13, 2022 · 2 comments
Labels
BREAKING This is a breaking change pr welcome

Comments

@headwindz
Copy link
Contributor

headwindz commented Jan 13, 2022

How to reproduce:

  1. Open Sandbox
  2. Check the console output

Current behavior

  • For invalid rgb input (E.g. "rgb(277,0,0)"), r is rounded to the nearest valid value 255 and a value is returned.
  • For invalid hex input (E.g. "#p10000"), an exception is thrown.

Expected behavior

Exceptions are expected to be thrown for all invalid inputs (i.e. for input that can't be turned into an equivalent color).

Extra info

Probablly related to this code: https://github.com/Qix-/color-string/blob/4daceef89391f28eba415d043bbd1163c8f19a8c/index.js#L128

@Qix-
Copy link
Owner

Qix- commented Apr 5, 2022

I agree though this is a breaking change. It'd have to wait for v5 unfortunately.

@Qix- Qix- added pr welcome BREAKING This is a breaking change labels Apr 5, 2022
@headwindz
Copy link
Contributor Author

Any plan for v5 😃

@Qix- Qix- reopened this Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING This is a breaking change pr welcome
Projects
None yet
Development

No branches or pull requests

2 participants