Skip to content

Bump colorjs.io from 0.5.2 to 0.6.0#412

Closed
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/colorjs.io-0.6.0
Closed

Bump colorjs.io from 0.5.2 to 0.6.0#412
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/colorjs.io-0.6.0

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 29, 2025

Bumps colorjs.io from 0.5.2 to 0.6.0.

Release notes

Sourced from colorjs.io's releases.

v0.6.0

This has taken a while and three pre-releases, but we wanted to make sure we got everything right. This is likely to be the last v0.x release, as Color.js is certainly mature enough to go to v1 in the next major version. Speaking of maturity…

⬇️ Over 100 million downloads! 🤯

Color.js has now been downloaded over 114 million times on npm! The rate of increase is still accelerating, currently at 3.5 million downloads per week!

We even had to automate updating the number in our README so we could have a chance to keep up (thanks @​MysteryBlokHed!).

Making Color.js sustainable

You may have noticed we removed ads from the Color.js website a while back. While Carbon ads were the good kind of ads (relevant, not intrusive), it was not really worth it, they barely made enough to cover costs like the domain name etc.

Instead, we have started an Open Collective that you can fund directly. If your company depends on Color.js in any way, it is in your best interest to ensure its future is sustainable.

Once there are enough sponsors, we plan to feature them prominently on our website and README, so if you want to be among the first ones to get your name in there, now’s the chance:

Breaking changes

There are a number of breaking changes in this release, but they should only negatively affect some pretty specialized use cases.

null instead of NaN to represent none values

As announced in v0.5.0, we have now switched to using null instead of NaN to represent none values (naturally occurring when converting achromatic colors to certain color spaces). Not only is null conceptually closer, but since CSS also now has a NaN value, this change allows us to represent it properly, using an actual NaN value.

NaN continues to be parsed (and becomes NaN in JS). Instead of being serialized as NaN (which is invalid in CSS), it is serialized as calc(NaN) which is a valid CSS coordinate. For roundtripping to work properly, this also means we now parse calc(NaN) as well. Slippery slope? We’ll see. 😁

(by @​leaverou in cdf6f0d5e97caa8e2edfd1e43a7fa1d857f99aa4, @​facelessuser in #476, @​mysteryblokhed in #530)

Programmatically detecting how none is represented

If you are working with any code that needs to handle Color instances/objects generically, without knowing which version of Color.js they come from, you can detect which value is being used and use that instead of a hardcoded null or NaN:

let noneCoord = new Color("rgb(none none none)").coords[0];
const NONE_VALUE = noneCoord?.valueOf() ?? noneCoord;

Plain numbers instead of Number objects for coordinates

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Dec 29, 2025
@Goodwine Goodwine requested a review from nex3 January 14, 2026 22:23
@Goodwine
Copy link
Member

Hi @nex3 , please take a look at the changes that were necessary to fix the typing changes on colorjs.io v6 at lib/src/value/color.ts

@Goodwine
Copy link
Member

@dependabot recreate

Bumps [colorjs.io](https://github.com/color-js/color.js) from 0.5.2 to 0.6.0.
- [Release notes](https://github.com/color-js/color.js/releases)
- [Commits](color-js/color.js@v0.5.2...v0.6.0)

---
updated-dependencies:
- dependency-name: colorjs.io
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/colorjs.io-0.6.0 branch from 65825fb to 28089c0 Compare January 15, 2026 00:20
@Goodwine
Copy link
Member

@nex3, Actually, I wasn't able to complete this upgrade. Besides having to add this to tsconfig.json:

"paths": {
  "colorjs.io": "node_modules/colorjs.io/...something.../types.d.ts"
}

The API for Coords changed so that null represents a missing channel instead of NaN. I tried updating the types, and even going as far as to force value ?? NaN just to keep the changes to a minimum, but I still got errors when comparing colors such as:

expected oklch(72.969% 0.25941 347.15) to loosely equal oklch(71.853% 0.24689 349.68), but channels at indices 0,1,2 differ

@nex3
Copy link
Contributor

nex3 commented Jan 15, 2026

That error doesn't looks like a missing channel error so much as a straightforward difference in a color calculation. Can you reduce it to a minimal example that just uses the Color.js API so we can examine it more closely?

@ntkme
Copy link
Contributor

ntkme commented Jan 16, 2026

I wasn't able to complete this upgrade. Besides having to add this to tsconfig.json

I think the change you need is:

{
  "compilerOptions": {
    "moduleResolution": "node16"
  }
}

https://www.typescriptlang.org/tsconfig/#moduleResolution

@Goodwine
Copy link
Member

Re:なつき -

Updating moduleResolution is an option if we don't mind updating this package/repo to be an ESM. We don't publish this to npm, do we? If we don't, then I guess that's a better option, but it may require additional changes for "config" JS files that currently assume they are in an CJS world 🤔 (not an issue either, just may increase the diff more than intended, maybe it could land on a follow-up PR?)

Anyways, the colorjsio API (and behavior?) did change between versions, so this PR will need additional changes

@ntkme
Copy link
Contributor

ntkme commented Jan 16, 2026

it may require additional changes for "config" JS files that currently assume they are in an CJS world

On node >=20.19.0, you can now require() esm module from CJS and it just works. So technically when we drop node 18 that will no longer be an issue.

  • Node 18 is already EOL, and Node 20 is set to be EOL in 3 month. From dart-sass' compatibility policy it's all good.
  • However, Ubuntu is very popular, and 24.04 default to node 18, which might cause some noises from users.
  • Ubuntu 26.04 is also coming out in about 3 month with newer default node version.

My take is that let's bump the required node version to >=20.19.0 once Ubuntu 26.04 is out, and that should solve a lot CJS/ESM compatibility issues. In fact, we have a similar situation on chokidar 5.0 upgrade on dart-sass side, which I propose to take the same approach after April.

@nex3
Copy link
Contributor

nex3 commented Jan 17, 2026

I think @ntkme's proposal here is sound.

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 19, 2026

Superseded by #415.

@dependabot dependabot bot closed this Jan 19, 2026
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/colorjs.io-0.6.0 branch January 19, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants