javascript-color-gradient is a lightweight JavaScript library designed for generating an array of color gradients. It allows users to define a gradient by providing two or more hexadecimal start and end colors, along with the desired number of midpoints. The library is currently at version 2.5.0 and appears to have an active, though not rapid, release cadence with updates focused on improvements and bug fixes, such as refactoring color generation logic and adding support for short hex codes in its most recent release. Its key differentiator is its simplicity and direct focus on generating color arrays for gradients, making it suitable for web and Node.js projects requiring programmatic color interpolation without complex UI components. It avoids external dependencies, offering a lean solution for color manipulation.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
The library primarily uses ES modules (ESM). CommonJS `require()` may not work as expected in newer versions without specific transpilation or Node.js 'type: module' configuration.
For dynamic ESM imports in environments that support it, or when mixing with CommonJS contexts.
Demonstrates how to initialize a gradient with two colors and retrieve an array of 10 interpolated hex color values.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.
No traffic data recorded yet.