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

NaN values from color scale after upgrading to v3 #359

Closed
aeharding opened this issue Oct 13, 2024 · 1 comment
Closed

NaN values from color scale after upgrading to v3 #359

aeharding opened this issue Oct 13, 2024 · 1 comment
Labels

Comments

@aeharding
Copy link

Hello! I upgraded chroma-js and I am seeing NaN in the color output.

Example:

chroma
  .scale([
    "#0000004d",
    "#6666660e",
    "#ffffff0a",
    "#ffffff0a",
    "#6666660e",
    "#0000004d",
    "#0000004d",
    "#6666660e",
    "#ffffff0a",
    "#ffffff0a",
    "#6666660e",
    "#0000004d",
  ])
  .mode("lch")
  .domain([
    1728731361199, 1728737481199, 1728745761199, 1728759068024, 1728760868024,
    1728777068024, 1728817832257, 1728823952257, 1728832232257, 1728845367827,
    1728847167827, 1728863367827,
  ]);

Then,

console.log(colorScale(1728856800000).css()

with chroma-js 3.1.1 incorrectly returns

rgb(NaN NaN NaN / 0.19864464506172852) 

With chroma-js 2.4.2 it worked properly, returning:

rgba(43,43,43,0.19864464506172852)
@gka gka added the bug label Oct 13, 2024
@gka gka closed this as completed in 27a2bb3 Oct 13, 2024
@gka
Copy link
Owner

gka commented Oct 13, 2024

✅ fixed in chroma.js v3.1.2

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

No branches or pull requests

2 participants