Skip to content
brownie.tools

Random Color Generator

Explore pastel, vivid, or dark colors, copy four formats, and revisit 12 recent swatches.

Runs locally in your browser. Nothing is uploaded or sent to a server.

Click Generate New Color to get a random color with HEX, RGB, HSL, and CMYK values and its closest CSS color name. Choose Pastel, Vivid, or Dark to constrain the tone, then Warm or Cool to restrict hue; Any ignores the hue filter. Copy one format or use Copy All for all four. Revisit up to 12 recent swatches, or pass the current color to the linked contrast, shade, and palette tools.

Updated

Pick colors straight from any web page with the free Color Picker extension — HEX, RGB, HSL and OKLCH in one click. Add to Chrome · Add to Edge · Add to Firefox

How do you generate a color and keep a useful result?

Click Generate New Color to replace the preview with a random color and see four copyable representations in Color Values. No input color is required. Start with Any for unrestricted RGB sampling, or select Pastel, Vivid, or Dark for a particular tone. For those three presets, choose Warm or Cool to narrow the hue family before generating.

For a soft blue starting point, choose Pastel and Cool, then generate until a candidate fits your project. The controls set the next draw; selecting a preset alone does not recolor the current preview. Copy a useful result immediately or return to its swatch under Recent Colors. This is a single-color exploration tool: it does not generate a coordinated palette in one action.

What would one generated color look like in all four formats?

Suppose a draw produces RGB channels 163, 196, and 247. The table shows the values calculated by this tool. This is a possible result, not a value you can request with a seed or paste into this generator. Use Color Converter when you already have a specific color to enter.

One RGB result expressed in the tool's four output formats
FormatDisplayed valueCalculation detail
HEX#A3C4F7163, 196, and 247 become hexadecimal A3, C4, and F7.
RGBrgb(163, 196, 247)The original integer channels are retained.
HSLhsl(216, 84%, 80%)Hue, saturation, and lightness are rounded to whole numbers.
CMYKcmyk(34%, 21%, 0%, 3%)Each calculated ink percentage is rounded.

HSL lightness is (247 + 163) ÷ (2 × 255), or about 80.39%, displayed as 80%. CMYK black is 1 − 247/255, about 3.14%, displayed as 3%. Copy All includes the four values on separate lines prefixed HEX:, RGB:, HSL:, and CMYK:. For a stylesheet, copy an individual HEX, RGB, or HSL value instead of pasting the labeled block as a declaration.

How do tone presets and hue filters combine?

Pastel, Vivid, and Dark sample integer HSL values before converting them to integer RGB channels. These controls constrain different properties: tone sets saturation and lightness, while Hue Range selects a hue interval. Any follows a separate RGB path and ignores Warm or Cool, even when one of those buttons remains selected.

Sampling rules before RGB conversion
Color ToneSaturationLightnessHue Range applied?
AnyNot sampled in HSLNot sampled in HSLNo; each RGB channel is 0–255
Pastel25–55%78–92%Yes
Vivid85–100%42–58%Yes
Dark40–95%12–32%Yes

All Hues samples 0–359°. Warm samples 0–60° or 330–360°; Cool samples 150–270°. Converting HSL to RGB and back can shift the displayed hue near an interval boundary. The generator checks that displayed hue, retries up to 10 times, and then uses a central hue of 15° for Warm or 210° for Cool. Displayed saturation and lightness can also change slightly through rounding.

What do the formats and approximate color name mean?

HEX represents three RGB channels as six hexadecimal digits, giving 256 × 256 × 256 = 16,777,216 possible integer RGB combinations. RGB shows those channels directly. HSL separates hue, saturation, and lightness; it is useful for understanding a color's position on the hue wheel. Because the tool rounds HSL to integers, copying it back through another conversion need not reproduce the original RGB exactly.

CMYK expresses cyan, magenta, yellow, and black percentages using a mathematical RGB conversion. Pure black is handled separately as 0%, 0%, 0%, 100%. There is no ICC printer profile selection or proofing step here, so printed output is not guaranteed to match the screen. The CMYK string is a reference value; use a color-managed print workflow for production.

The name beneath the HEX value is the nearest entry in the engine's CSS named-color list, measured with redmean weighted RGB distance. The tilde signals an approximation. Copy the numeric value to preserve your actual candidate; replacing it with the displayed name can change the color.

How do history and the Space shortcut behave?

Recent Colors stores up to 12 distinct HEX values, newest first. Restoring a swatch also moves it to the front. Generating a duplicate moves that existing color rather than adding another copy. The initial preview is outside history until generation starts. History is held in component memory and disappears on refresh or when the component is remounted; it is not a saved collection.

Space generates when focus is outside buttons, inputs, textareas, selects, editable content, and elements with the textbox role. If Space appears inactive after clicking a control, focus may still be on that button. Use Generate New Color directly or move focus outside the controls. Generation uses Math.random(); there is no user seed, reproducible sequence, or cryptographic randomness guarantee.

How does random generation explore the color space?

Any draws each of the three integer RGB channels separately using Math.random(). This explores the RGB cube rather than selecting a hue first. Equal numerical opportunities in that cube do not produce equal opportunities for every perceived lightness or hue category. A random color is also not selected according to your brand, surrounding colors or intended audience.

The constrained tones follow a different route: sample hue, saturation and lightness within their configured ranges, then convert to RGB. That creates a deliberately different distribution from Any. Repeated candidates are possible, and generating several times does not guarantee coverage of all hue families. Copy a promising value if you want to return to it; the tool does not offer a seed for reproducing a draw.

When are random colors useful in a design workflow?

Use a draw to break an initial choice deadlock in a mood board, illustration or interface prototype. Assign the candidate a concrete role, such as an accent on a neutral surface, and evaluate it there. Randomness proposes a starting value; it does not decide whether that value suits the content or the people using the design.

For sample charts or placeholder categories, inspect the colors together before assigning meanings. Independently generated colors can be too similar to distinguish, especially in small marks. Add labels or patterns and keep category assignments stable after review. For a production theme, save the approved codes as named tokens instead of generating replacement colors each time the interface renders.

How do you turn a random color into a usable design?

Use Pastel for a light surface candidate, Vivid for an accent candidate, and Dark for a deeper surface candidate. These are starting points, not accessibility ratings. The preview selects white or black lettering using relative luminance and a 0.179 threshold. That decision concerns the preview label only; it does not test your planned text, icons, backgrounds, or interaction states.

Choose Check contrast ratio for your actual foreground and background pair. WCAG 2.2 Success Criterion 1.4.3 requires at least 4.5:1 for normal text and 3:1 for large text, subject to its exceptions. A tone name or HSL lightness percentage does not establish that ratio.

Color theory offers starting relationships: complementary hues are 180° apart, triadic hues are 120° apart, and analogous colors use neighboring hues. Those relationships describe hue spacing rather than readable text contrast. Choose Generate a palette to continue exploring combinations, or Build shade scale for tonal variations. Each inline link carries the current HEX color in the URL fragment so you can continue from the same candidate.

How to Use Random Color Generator

  1. Color Tone

    Select Any for random RGB channels, or choose Pastel, Vivid, or Dark for a constrained HSL tone. Changing a selection does not replace the current color until you generate again.

  2. Hue Range

    Choose All Hues, Warm, or Cool. Warm and Cool apply with Pastel, Vivid, or Dark; Any ignores this setting.

  3. Generate New Color

    Click Generate New Color to update the preview and Color Values. Space also generates when focus is outside buttons and editable controls.

  4. Color Values

    Use the copy button beside HEX, RGB, HSL, or CMYK, or choose Copy All for a labeled four-line block.

  5. Recent Colors

    Click a recent swatch to restore it and move it to the front. Use Check contrast ratio, Build shade scale, or Generate a palette to continue with the current color.

Frequently Asked Questions