#color Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
PHP RGB ↔ Hex Conversion
Two-way conversion between #RRGGBB hex strings and [R, G, B] arrays. Handy when working with theme colors that come from both sources (CSS strings vs. RGB sliders).
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.
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.
Bash ANSI Color Output Helpers
Wrap printf with ANSI escape codes for color and bold. Auto-disable if stdout isn't a TTY (so piping to a file doesn't pollute it with escape sequences).
PHP Validate Hex Color
Accept #RGB, #RGBA, #RRGGBB, or #RRGGBBAA hex colors (with or without the leading #). Returns the normalized 6/8-digit lowercase form.