Skip to content

Bump invert-color from 2.0.0 to 3.0.0 - #73

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/invert-color-3.0.0
Open

Bump invert-color from 2.0.0 to 3.0.0#73
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/invert-color-3.0.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 30, 2026

Copy link
Copy Markdown
Contributor

Bumps invert-color from 2.0.0 to 3.0.0.

Release notes

Sourced from invert-color's releases.

v3.0.0

⚠️ Breaking: this release is ESM-only. require('invert-color') and the UMD browser bundle (lib/invert.min.js) are gone, and the minimum Node.js is now 20. Staying on CommonJS/UMD? Pin npm i invert-color@2. Everything below the packaging is source-compatible — the invert() API is unchanged.

Modernization release. The callable API — invert(), invert.asRGB(), invert.asRgbArray(), invert.asRgbObject() and invert.defaultThreshold — behaves exactly as in v2; the only runtime-behavior change is stricter, more predictable handling of out-of-range and malformed input (see below).

Added

  • CSS rgb() / rgba() string input. invert('rgb(40, 43, 53)') and invert('rgba(40, 43, 53, 0.5)') now work; an rgba() alpha below 1 is preserved on invert() as the trailing hex byte (#rrggbbaa), while asRGB / asRgbArray return RGB only. Resolves #21 (#22, thanks @​luatnd).
  • Plain number[] array input. invert.asRGB(channels) where channels: number[] now type-checks — the accepted array type was widened from the strict [number, number, number] tuple (still the return type). Resolves #23.
  • A named export: import { invert } from 'invert-color' now works alongside the default import invert from 'invert-color' (both resolve to the same function).
  • Input validation. Array/object colors must have exactly 3 finite channels — a wrong-length array or a non-finite channel (NaN/Infinity) now throws a clear error, matching the existing HEX validation.

Changed

  • BREAKING — ESM-only. Dropped the CommonJS and UMD bundles; the package now ships a single ESM build with type declarations. require('invert-color') and the lib/invert.min.js browser file are gone. If you need CommonJS/UMD, pin invert-color@2.
  • BREAKING — engines. Now requires Node.js >= 20.
  • Out-of-range channels are now clamped to 0255 and rounded, so they degrade predictably (invert([300, 300, 300]) → '[#000000](https://github.com/onury/invert-color/issues/000000)'). Previously such values produced an artifact of the last two hex digits (→ '#2d2d2d'). Valid 0255 colors are unaffected.
  • Rewrote the internals against modern JavaScript: String.prototype.padStart, object spread, the ** operator, and small pure helpers replace the hand-rolled zero-pad, Object.assign and Math.pow. Output for valid colors is identical.
  • Enabled strict TypeScript; tightened and re-exampled the public type declarations (TSDoc with @example blocks).

Removed

  • The browser, module and jsnext:main bundle fields and the multi-format build (rollup + uglify). Replaced by a single tsc build and an exports map.

Tooling

  • Migrated the toolchain: Biome (from TSLint), Vitest (from Jest), GitHub Actions (from Travis), and Stryker mutation testing.
  • Test suite reaches 100% coverage (statements, branches, functions, lines) and a 100% mutation score.
Changelog

Sourced from invert-color's changelog.

3.0.0 (2026-07-23)

⚠️ Breaking: this release is ESM-only. require('invert-color') and the UMD browser bundle (lib/invert.min.js) are gone, and the minimum Node.js is now 20. Staying on CommonJS/UMD? Pin npm i invert-color@2. Everything below the packaging is source-compatible — the invert() API is unchanged.

Modernization release. The callable API — invert(), invert.asRGB(), invert.asRgbArray(), invert.asRgbObject() and invert.defaultThreshold — behaves exactly as in v2; the only runtime-behavior change is stricter, more predictable handling of out-of-range and malformed input (see below).

Added

  • CSS rgb() / rgba() string input. invert('rgb(40, 43, 53)') and invert('rgba(40, 43, 53, 0.5)') now work; an rgba() alpha below 1 is preserved on invert() as the trailing hex byte (#rrggbbaa), while asRGB / asRgbArray return RGB only. Resolves #21 (#22, thanks @​luatnd).
  • Plain number[] array input. invert.asRGB(channels) where channels: number[] now type-checks — the accepted array type was widened from the strict [number, number, number] tuple (still the return type). Resolves #23.
  • A named export: import { invert } from 'invert-color' now works alongside the default import invert from 'invert-color' (both resolve to the same function).
  • Input validation. Array/object colors must have exactly 3 finite channels — a wrong-length array or a non-finite channel (NaN/Infinity) now throws a clear error, matching the existing HEX validation.

Changed

  • BREAKING — ESM-only. Dropped the CommonJS and UMD bundles; the package now ships a single ESM build with type declarations. require('invert-color') and the lib/invert.min.js browser file are gone. If you need CommonJS/UMD, pin invert-color@2.
  • BREAKING — engines. Now requires Node.js >= 20.
  • Out-of-range channels are now clamped to 0255 and rounded, so they degrade predictably (invert([300, 300, 300]) → '[#000000](https://github.com/onury/invert-color/issues/000000)'). Previously such values produced an artifact of the last two hex digits (→ '#2d2d2d'). Valid 0255 colors are unaffected.
  • Rewrote the internals against modern JavaScript: String.prototype.padStart, object spread, the ** operator, and small pure helpers replace the hand-rolled zero-pad, Object.assign and Math.pow. Output for valid colors is identical.
  • Enabled strict TypeScript; tightened and re-exampled the public type declarations (TSDoc with @example blocks).

Removed

  • The browser, module and jsnext:main bundle fields and the multi-format build (rollup + uglify). Replaced by a single tsc build and an exports map.

Tooling

  • Migrated the toolchain: Biome (from TSLint), Vitest (from Jest), GitHub Actions (from Travis), and Stryker mutation testing.
  • Test suite reaches 100% coverage (statements, branches, functions, lines) and a 100% mutation score.
Commits
  • 9b9896d feat: accept number[] and rgb()/rgba() string input
  • d095220 docs: match README badges to the house model; drop Related section
  • 00f271c feat!: validate and clamp color input; highlight the ESM break
  • 8df14a8 feat!: modernize to ESM-only (v3.0.0)
  • 8beb46c chore: rename the scratch dir to _backup/
  • 026ad95 update readme [skip ci]
  • cd18393 Update README.md
  • 5bd53d1 Update LICENSE
  • See full diff in compare view

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Jul 30, 2026
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/invert-color-3.0.0 branch from a47613c to 992548f Compare July 31, 2026 20:40
@AlexZ005

Copy link
Copy Markdown
Collaborator

Deferring: invert-color 2->3 will be evaluated on the release/next integration branch with the other majors (it needs a runtime check of the color-inversion call sites, not just a compile).

Bumps [invert-color](https://github.com/onury/invert-color) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/onury/invert-color/releases)
- [Changelog](https://github.com/onury/invert-color/blob/master/CHANGELOG.md)
- [Commits](onury/invert-color@v2.0.0...v3.0.0)

---
updated-dependencies:
- dependency-name: invert-color
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/invert-color-3.0.0 branch from 992548f to ab5d232 Compare August 5, 2026 23:43
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.

1 participant