</>PackageGraphPackageGraph

color-string

npmv2.1.4TypeScript

Parser and generator for CSS color strings

Safe to adopt

Yes — color-string scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 298 days ago. 6 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • BMaintenance: grade B, Good.

    Last published 298 days ago. 6 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Pulls in 1 transitive package, about 17 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding color-string to a project.

1
Direct dependencies

Runtime packages this one declares itself.

1
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

17 KB
Install size

Unpacked size of this package plus its entire runtime tree.

1
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

MIT

Every license you inherit by installing color-string, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node >=18
Module format
ESM only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the color-string README.

colorString.get('#FFF')                          // {model: 'rgb', value: [255, 255, 255, 1]}
colorString.get('#FFFA')                         // {model: 'rgb', value: [255, 255, 255, 0.67]}
colorString.get('#FFFFFFAA')                     // {model: 'rgb', value: [255, 255, 255, 0.67]}
colorString.get('hsl(360, 100%, 50%)')           // {model: 'hsl', value: [0, 100, 50, 1]}
colorString.get('hsl(360 100% 50%)')             // {model: 'hsl', value: [0, 100, 50, 1]}
colorString.get('hwb(60, 3%, 60%)')              // {model: 'hwb', value: [60, 3, 60, 1]}

colorString.get.rgb('#FFF')                      // [255, 255, 255, 1]
colorString.get.rgb('blue')                      // [0, 0, 255, 1]
colorString.get.rgb('rgba(200, 60, 60, 0.3)')    // [200, 60, 60, 0.3]
colorString.get.rgb('rgba(200 60 60 / 0.3)')     // [200, 60, 60, 0.3]
colorString.get.rgb('rgba(200 60 60 / 30%)')     // [200, 60, 60, 0.3]
colorString.get.rgb('rgb(200, 200, 200)')        // [200, 200, 200, 1]
colorString.get.rgb('rgb(200 200 200)')          // [200, 200, 200, 1]
Example truncated — see the full README.

color-string vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
color-stringthis page01MIT9 months ago
color-convert299.6M1MIT1 day ago
color45.5M3MIT1 day ago
@csstools/css-color-parser02MIT1 day ago
rgb2hex01MIT1 day ago
color-name306.6M3MIT1 day ago

Dependencies

Declared by color-string v2.1.4. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (2)

tsd ^0.31.2xo ^0.60.0

Used by

Popular packages that depend on color-string.

Relationship graph

Dependencies (left) and dependents (right) of color-string.

color-namecolorcolor-string
color-string dependencies dependents

Frequently installed together

Release history

6 releases in the last two years, typically about 8 days apart.

Recent versions of color-string
VersionPublishedSizeLicense
2.1.4latest9 months ago11 KBMIT
2.1.39 months ago11 KBMIT
2.1.21 year ago11 KBMIT
2.1.01 year ago11 KBMIT
2.0.11 year ago10 KBMIT
2.0.01 year ago10 KBMIT
1.9.14 years ago9.9 KBMIT
1.9.04 years ago9.9 KBMIT
1.8.24 years ago9.8 KBMIT
1.8.14 years ago9.7 KBMIT
1.8.04 years ago9.7 KBMIT
1.7.44 years ago9.7 KBMIT
1.7.34 years ago9.7 KBMIT
1.7.24 years ago9.7 KBMIT
1.7.14 years ago9.6 KBMIT

Overview

color-string is an npm package that parser and generator for CSS color strings. It has 1 known dependents in the graph. The latest version is 2.1.4, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need parser and generator for CSS color strings and value a focused solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).
  • Lean dependency tree (3 direct dependencies).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use color-string?

Yes — color-string scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 298 days ago. 6 releases in the last 2 years.

How do I install color-string?

Run `npm install color-string` to add color-string to your npm project.

How many dependencies does color-string have?

color-string declares 3 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 17 KB on disk.

What license is color-string released under?

color-string is distributed under the MIT license.

How popular is color-string?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on color-string.

Is color-string still maintained?

The most recent release of color-string (v2.1.4) was published 9 months ago.

Does color-string run install scripts?

No. color-string does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.