Convertir RGB colors to HEX (and back)
Translate color valeurs entre rgb() et #rrggbb notation, avec alpha-channel handling pour CSS fonctionner.
- 1 Convertisseur de couleur →
Paste rgb(90, 200, 250) to get #5AC8FA, or paste a hex value to get its rgb() form. 8-digit hex with alpha (#5AC8FAFF) converts to rgba() notation.
- 2
Details worth knowing: HEX and rgb() are the same color space (sRGB) in different syntax — conversion is lossless; 3-digit hex (#F0A) is shorthand for #FF00AA; CSS colors work — named colors and hsl() inputs are converted too. When precision matters (design tokens), prefer 6-digit hex or rgb() over 3-digit shorthand.
- 3 Vérificateur de contraste de couleur →
After converting, check the color against your background: WCAG contrast ratios determine whether text passes accessibility thresholds (4.5:1 for body text, 3:1 for large text).
Questions fréquentes
- Is HEX more accurate than RGB?
- No — they express identical sRGB values. #5AC8FA and rgb(90, 200, 250) are the same color; pick whichever your tooling expects.
- How is alpha handled?
- 8-digit HEX encodes alpha as the last byte (#RRGGBBAA), and rgba() takes alpha as 0–1. An alpha of FF / 1.0 is fully opaque.
Workflows résolvant cette tâche
Outils associés
Convertisseur de couleur
Convert colors between HEX, RGB, HSL, HSV, and CMYK color spaces. Auto-detects input format. Gratuit, privé et 100% côté client. OUTIL
Vérificateur de contraste de couleur
Check WCAG color contrast ratio between foreground and background colors and verify AA/AAA compliance. Gratuit, privé et 100% côté client. OUTIL
Mélangeur de couleurs
Blend two colors by ratio using normal, multiply, screen, overlay, darken, or lighten blend modes. Gratuit, privé et 100% côté client. OUTIL