RGB/RGBA to Hex Color Parser

JSON →
library 0.2.5 ·javascript maintenance
verified May 27, 2026

rgb2hex is a lightweight JavaScript library designed to parse RGB and RGBA color strings into their hexadecimal representation, including an alpha value for transparency. It operates without any external dependencies, making it suitable for environments where bundle size is critical. The current stable version is 0.2.5, released in November 2020. While updates have been infrequent since then, the library provides a focused solution for color conversion. A key differentiator is its minimal footprint and direct functionality, contrasting with larger color manipulation libraries that offer broader feature sets. It includes TypeScript type definitions for enhanced developer experience in modern projects. The library gained significant stability and security improvements between its early `v0.1.x` and `v0.2.x` releases, particularly addressing RegExp Denial of Service vulnerabilities.

total hits 36
actors 8 distinct systems
last hit 1d ago MetaBot
GPTBot
5
MetaBot
4
Script
1
ClaudeBot
1
Search engines
3

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇩🇪 Germany · 🇫🇷 France · 🇳🇴 Norway