Color Converter
Convert between HEX, RGB, and HSL formats.
When to Use Each Color Format
HEX (Hexadecimal): The standard for web design (CSS, HTML). Best for copy-pasting between design tools like Figma and your code.
RGB (Red, Green, Blue): Used for digital screens and when you need to programmatically manipulate colors (e.g., adding transparency with RGBA).
HSL (Hue, Saturation, Lightness): Ideally suited for human understanding. It's much easier to 'make this color brighter' or 'make this color pastel' using HSL values.
Color Formats Explained
HEX codes use a 6-digit (or 3-digit) hexadecimal number to represent red, green, and blue components. Example: #FF5733.
RGB values range from 0 to 255 for each channel (Red, Green, Blue). (255, 0, 0) is pure red.
HSL defines color by Hue (0-360 degrees on color wheel), Saturation (0-100% intensity), and Lightness (0-100% from black to white).
Basic Color Theory
Understanding how colors interact can help you create better designs.
Complementary: Colors opposite each other on the wheel. Creates high contrast and impact.
Analogous: Colors next to each other on the wheel. Creates harmonious, serene designs.
Triadic: Three colors evenly spaced on the wheel. Offers vibrant contrast while maintaining balance.
Accessibility & Contrast
Ensuring your colors are accessible is crucial for all users.
Always check the contrast ratio between text and background. Aim for at least 4.5:1 for normal text (WCAG AA standard).
Don't rely on color alone to convey meaning (e.g., error messages). Use icons or text labels as well.
Use tools to simulate color blindness to ensure your design remains usable for everyone.
Using CSS Variables
Modern CSS allows you to store colors in variables for easy theming. Example: :root {--primary-color: #3b82f6;}
Quick Color Reference
#FFFFFF White#000000 Black#FF0000 Red#00FF00 Green#0000FF Blue#FFFF00 Yellow#00FFFF Cyan#FF00FF Magenta