Convertitore da HEX a RGB e HSL
Converti un colore esadecimale a tre o sei cifre in RGB e HSL.
Dati
Suggerimento: premi Ctrl + Enter per eseguire
Impostazioni salvate
Per ora la guida dettagliata qui sotto è disponibile solo in inglese.
Informazioni su questo strumento
Designers hand over colours as HEX codes, CSS can use RGB or HSL, and HSL is the easiest form for making a colour lighter or darker by hand. This converter takes a three- or six-digit hexadecimal colour and returns the normalized HEX code, the RGB values and the HSL values, ready to paste into CSS.
Come si usa
- Enter a HEX colour such as #1e90ff or the short form #abc (the # is optional).
- Run the conversion.
- Copy the rgb() or hsl() value you need.
- To make a lighter tint, raise the lightness percentage in the HSL value.
Come funziona il calcolo
Short codes are expanded (#abc becomes #aabbcc). Each pair of hex digits is converted to a 0–255 channel, and RGB is converted to hue (degrees), saturation and lightness (percentages), rounded to whole numbers.
HEX → RGB → HSLEsempio pratico
The colour #1e90ff ("dodger blue") converts to rgb(30, 144, 255) and hsl(210, 100%, 56%). Changing the lightness to 85% in CSS gives a pale tint of the same hue for a background. The short code #abc expands to #aabbcc.
Esempio di input e risultato
#ff0000 → rgb(255, 0, 0) → hsl(0, 100%, 50%)
Limiti
- 3- and 6-digit HEX input only.
- No alpha channel, CMYK or named colours.
- HSL values are rounded.
Ultimo aggiornamento:
Domande frequenti
Can I convert RGB to HEX?
This tool converts from HEX. Write each RGB channel as two hex digits with the number base converter.
Are 8-digit HEX codes with transparency supported?
No. Remove the last two (alpha) digits first.
Why are HSL values rounded?
Whole numbers are easier to read and edit; the rounding changes the colour by less than one RGB step.
Risoluzione dei problemi
It rejects my colour.
Check for 8 digits (alpha), invalid letters beyond f, or extra spaces.
Printed colours look different.
Screens use RGB; printers use CMYK, and some RGB colours cannot be printed exactly.
The HSL round trip gives a slightly different HEX.
Rounding HSL to whole numbers can shift one channel by one step.
Privacy & Gratuito
I miei dati vengono salvati?
I tuoi dati restano in questa scheda. Non riceviamo i tuoi file, i testi incollati né i valori dei calcoli.
Questo strumento è gratuito?
Sì. Non servono registrazione né pagamento.
Vedi anche
Passi successivi utili
Formattatore e validatore JSON
Valida, formatta o minimizza JSON in locale. I dati non validi non vengono mai inviati a un server.
Sviluppo e SEOConvertitore da CSV a JSON
Converti intestazioni e record CSV in JSON, con delimitatori tra virgolette e a capo.
Sviluppo e SEOConvertitore da JSON a CSV
Converti un array piatto di oggetti in CSV. Le stringhe simili a formule ricevono un prefisso protettivo per i fogli di calcolo.
Sviluppo e SEO