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

Idempotency failure cannot use chroma to return a same value.... #276

Open
Luxcium opened this issue Aug 3, 2021 · 2 comments
Open

Idempotency failure cannot use chroma to return a same value.... #276

Luxcium opened this issue Aug 3, 2021 · 2 comments

Comments

@Luxcium
Copy link

Luxcium commented Aug 3, 2021

When I am trying to test my application and I try to pass some value... I can't not get expected value: « chroma('FFBBCCDD').hex('rgba') -> #ffbbccde » or even with « chroma('#ff055088').hex() === '#ff055088' false #ff055087 »

console.log(
  "chroma('#ffa500bb').hex('rgba') === '#ffa500bb'",
  chroma('#ffa500bb').hex('rgba') === '#ffa500bb',
  chroma('#ffa500bb').hex('rgba')
);
// chroma('#ffa500bb').alpha(0.75).hex('rgba') === '#ffa500bb' false #ffa500ba

Screenshot_20210803_195611

❯ ts-node "[...]/pop-n-lock-theme-vscode/helpers/tools/functions/chroma-test.ts"
chroma('FFBBCCDD').hex('rgba') -> #ffbbccde
chroma('orange').hex() === '#ffa500' true
chroma('orange').alpha(0.75).hex() === '#ffa500bf' true #ffa500bf
chroma('#ff055088').hex('rgba') === '#ff055088' false #ff055087
console.log(
  "chroma('FFBBCCDD').hex('rgba') ->",
  chroma('FFBBCCDD').hex('rgba')
);
// chroma('FFBBCCDD').hex('rgba') -> #ffbbccde

Screenshot_20210803_193519

@Luxcium
Copy link
Author

Luxcium commented Aug 3, 2021

I am unable to pass my own tests ... I changed the value to reflect the erroneous result then I changed my code and ended up getting the expected result but the test failed because I imputed the other value (the erroneous one)

Screenshot_20210803_193024

@Luxcium Luxcium changed the title idempotency failure cannot use chroma to return a same value.... Idempotency failure cannot use chroma to return a same value.... Aug 3, 2021
@Luxcium
Copy link
Author

Luxcium commented Aug 4, 2021

I would have the same expectation for the short version:

console.log(
  "chroma('#f058').hex() === '#ff005588'",
  chroma('#f058').hex() === '#ff005588',
  chroma('#f058').hex()
  // chroma('#f058').hex() === '#f058' false #ff005587
);

Screenshot_20210803_202630

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