Back to Explore

Qix-/color-string

GitHub1 watchersOpen source

Last release:

A small JavaScript library for parsing and generating CSS color strings. It helps convert color inputs like hex, rgb, hsl, and hwb into structured color values, and generate CSS outputs such as hex, rgb/rgba, keywords, hsl, and hwb strings.

Project status

  • Maintenance status: The GitHub activity appears quiet/dormant relative to today, with the most recent upstream push on 2025-11-15 (about 9 months ago).
  • Update cadence: Prior to the quiet period, updates clustered in Sep to Nov 2025 (2.1.2 on 2025-09-13, then 2.1.3 and 2.1.4 within about 1 day of each other in 2025-11-14 to 2025-11-15).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 2.1.4

    Release 2.1.4 adds case-insensitive parsing for CSS color strings. The change primarily affects how the library matches color functions (like rgb, hsl, hwb, rgba with percentage alpha) and named keywords (like transparent and named colors).

    Features
  • 2.1.3

    color-string 2.1.3 updates parsing of rgb/rgba() to accept decimal fractions and scientific notation, and adds test coverage for these formats. It also fixes an issue where calling get.rgb() with a named color could produce incorrect results due to shared mutable state.

    Features
  • 2.1.2

    Release 2.1.2 is documented as functionally identical to 2.1.0, with a note that 2.1.1 was compromised. The provided code diff shows no behavioral changes, only a version string update in package.json.

  • 2.1.0

    Release 2.1.0 expands CSS color parsing to accept additional “no comma” syntaxes. It adds support for parsing `hwb()` written with whitespace separators, and it relaxes `rgb()`/`rgba()` parsing rules to accept space separated channel formats.

    Features
  • 2.0.1

    Release 2.0.1 updates the TypeScript typings for the color-string API to return null instead of undefined when parsing or converting fails. The published change log documents this typing adjustment, and the code diff shows corresponding updates to the type tests.

    Breaking