# Color Converter Convert HEX / RGB / HSL / names and build tints & shades — zero dependencies. ``` python scripts/run.py "#3498db" python scripts/run.py "rgb(52, 152, 219)" python scripts/run.py "hsl(204, 70%, 53%)" python scripts/run.py teal python scripts/run.py "#3498db" --tints 4 --shades 4 echo "#ff8800" | python scripts/run.py - ``` Pure Python stdlib (`colorsys` + `math`/`re`). --- name: color-converter display_name: Color Converter description: "Convert colors between HEX, RGB, HSL and CSS names, and generate tints and shades. Triggers: convert color, hex to rgb, rgb to hsl, color palette, tints, shades, lighten, darken." --- # Color Converter Convert a color across HEX / RGB / HSL and generate lighter/darker variants. ## When to use The user has a color in any common notation and wants it in the other notations, or wants a quick set of tints (lighter) or shades (darker) for a palette. ## How to use Run `scripts/run.py` with a color in any format: - `python scripts/run.py "#3498db"` — show HEX, RGB, and HSL. - `python scripts/run.py "rgb(52, 152, 219)"` — same, from RGB. - `python scripts/run.py teal` — CSS named colors are supported. - `python scripts/run.py "#3498db" --tints 4` — 4 lighter variants. - `python scripts/run.py "#3498db" --shades 4` — 4 darker variants. Accepts `#rgb`, `#rrggbb`, `rgb()/rgba()`, `hsl()/hsla()`, names, or `-` for stdin. ## Pitfalls - HSL values are rounded to whole numbers, so a round-trip may shift by 1 unit. - Tints mix toward white and shades toward black at evenly spaced ratios (e.g. `--tints 4` gives 20/40/60/80%). - Unknown color strings exit non-zero with an error.
Color Converter by langbot-team
Convert colors between HEX, RGB, HSL and CSS names, and generate tints and shades.
Loading...