Design
Color Hex Generator
Generate random hex colors with instant RGB and HSL conversions. Create color palettes for your projects. Perfect for web designers and developers.
Color Formats Explained
Hex, RGB, and HSL are three ways to represent colors in digital design. Hex codes use 6 characters (#RRGGBB). RGB mixes red, green, and blue light values (0-255). HSL describes color as hue, saturation, and lightness, often more intuitive for designers.
How the Conversions Work
Hex to RGB
A hex code splits into three 2-character pairs (#RRGGBB), and each pair is parsed as a base-16 number to get a 0-255 value for red, green, and blue. For example, #FF5733 splits into FF (255), 57 (87), and 33 (51).
RGB to HSL
The tool normalizes red, green, and blue to a 0-1 scale, then derives lightness from the average of the highest and lowest channel values, saturation from how far apart the channels are, and hue from which channel (red, green, or blue) is dominant. This is the standard cylindrical-coordinate conversion used across design software.
Color naming
A simple color name is assigned from the hue and saturation: low-saturation colors are labeled Black, White, or Gray by lightness, while saturated colors are bucketed into eight hue ranges (Red, Orange, Yellow, Green, Cyan, Blue, Purple, Pink) spanning the 360-degree color wheel.
Generating a Monochromatic Palette
Clicking "Generate Palette" takes your current color's hue and saturation and holds them fixed while stepping lightness from 20% up to 80% across 5 swatches. The result is a monochromatic set: five shades of the same base hue running from dark to light, which is a quick way to build a consistent color scale for buttons, charts, or UI states without picking each shade by hand.
Color Relationships Beyond Monochromatic
Complementary
Two colors sitting exactly opposite each other on the 360-degree hue wheel (roughly 180° apart). High contrast, good for calls to action against a muted background.
Analogous
Colors adjacent on the wheel, typically within about 30 to 60 degrees of hue. Produces a calm, cohesive look often used in nature-themed or editorial designs.
Triadic
Three colors spaced evenly around the wheel (120 degrees apart). Balanced and vibrant, a common choice for brand palettes that need multiple distinct accent colors.
This tool's HSL readout makes these relationships easy to build by hand: note the hue of your base color, then keep generating random colors (or typing hex values) until the HSL panel shows a hue roughly 180° away for a complementary pair, 30 to 60° away for an analogous set, or two hues each 120° away for a triadic trio, matching the saturation and lightness of your base color for the most harmonious result.
Common Use Cases
bg-[#FF5733].