#color Clear
Tags #utils #browser #performance #array #async #dom #objects #pattern #events #format #concurrency #http #ui #advanced #fetch #url #string #functional #cache #files #crypto #promise #intl #observer
JavaScript Random Hex Color
Generates a random 6-digit hex colour string. Useful for seeding avatar backgrounds, chart series colours, placeholder UI elements, and testing colour-dependent components. The crypto version produces a more unpredictable result suitable for generating unique palette tokens.
JavaScript Hex ↔ RGB Conversion
Converts between hex colour strings (#rrggbb / #rgb) and RGB component objects. hexToRgb parses both shorthand and full hex formats. rgbToHex converts R, G, B integers (0–255) back to a hex string. Handy for colour manipulation, generating CSS variables, and passing colour data between libraries.