Color Generator

Generate a random sRGB color and read it as HEX, RGB, and HSL. Copy HEX. Nothing is uploaded.

Last updated: October 4, 2026

Tool

This tool will load here.

What this generator does

A color generator picks a color and names it in more than one notation. This color generator draws each sRGB channel as an integer from 0 to 255 using crypto.getRandomValues. It then writes HEX, RGB, and HSL. HSL is converted from those integer channels with the usual cylindrical formulas and rounded to whole degrees and percents. That is enough to paste into a stylesheet. It is not a calibrated color-management workspace and not an accessibility contrast checker.

For a two-stop CSS gradient that uses colors as stops, open the CSS Gradient Generator. This page will not emit linear-gradient CSS. It will not build a 64-color palette. One swatch, three strings, copy HEX.

How to use

  1. Generate. A swatch and the three notations appear.
  2. Generate again for a new color.
  3. Copy HEX writes the #rrggbb value. Clear hides the swatch.

There is no text field to type a color on this page. The job is generation. Keyboard users can tab to Generate and activate it. The swatch is decorative; the HEX row is the value to copy.

Example

A draw of 13, 130, 243 becomes #0d82f3, rgb(13, 130, 243), and an HSL triple near hsl(210, 90%, 50%). Exact HSL depends on the rounding of the conversion. The HEX form always has six lowercase digits. Repeated generate changes the swatch. If Web Crypto is missing, the status says so instead of using Math.random.

Limits

  • sRGB integers only. No P3, no CMYK, no LAB.
  • No contrast ratio and no color-blind simulation.
  • Copy copies HEX, not RGB or HSL, in this batch.
  • Work stays in this browser.

If you needed two colors that work as a gradient, generate here for inspiration, then set the stops on the CSS Gradient Generator. If you needed a brand token, do not let a random draw replace a written spec. Random color is a starting point, not a design system.

HSL on this page is derived, not independently sampled. Sampling H, S, and L uniformly would not match uniform sRGB channel sampling. The page samples RGB so HEX and RGB stay exact integers. HSL is the convenience view.

The swatch uses the HEX as a CSS background. That is safe because the value is generated as six hex digits, not taken from a free-text field.

Copy HEX is the usual handoff into a design token or a CSS custom property. If you needed rgb() for a legacy rule, the RGB row is there to read. This batch does not put a second copy button on that row. Select the text if you must.

Repeated generate is the whole interaction. There is no lock to keep a color you liked except copy or write it down. The page will not keep a history of earlier draws. If you want a pair, generate twice and record both, or move to the CSS Gradient Generator and set two stops.

Black and white can appear. They are valid sRGB points. A draw of 0, 0, 0 is #000000. That is not a failure of the generator.

On this page

Related Articles

Related guides

Related solutions

Need another tool ?

Open the free tools — no signup.

FAQs

newsletter signup

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.