Random Color Generator

Generate 1–8 unique opaque sRGB colors, lock the ones you want to keep, and copy canonical HEX, RGB, or rounded HSL values.

1–8 unique opaque sRGB colors. Values stay in this page memory.

Browser-local: Web Crypto supplies random values. Colors are not uploaded, saved, added to the URL, or included in analytics.

How to generate and keep random colors

  1. Enter one whole-number count from 1 through 8.
  2. Select Generate colors or press Enter once.
  3. Lock colors you want to keep, then regenerate the unlocked rows or reroll one row. Copy one format or all HEX values in visual order.

HEX, RGB, and rounded HSL formats

Each generated value is one opaque 24-bit sRGB color. HEX uses uppercase #RRGGBB; RGB shows three integer channels from 0 through 255; HSL shows a whole-number hue, saturation percentage, and lightness percentage.

For a fixed format example, #FF5733, rgb(255, 87, 51), and hsl(11, 100%, 60%) describe the same opaque sRGB value. The HSL form is rounded for display, while HEX and RGB retain the exact channel integers. This example is explanatory; it is not a pre-generated random result.

How browser randomness and within-batch uniqueness work

The page asks browser Web Crypto for unsigned 32-bit values. It uses rejection sampling before mapping a value into the color space, avoiding modulo bias. A bounded retry guard stops a faulty source from hanging the page.

Visible colors are unique within the current batch. When you regenerate, locked rows keep their exact values and positions. Every unlocked row changes from the prior batch and from every other current row.

Limits, privacy, and scope

The count is limited to 1–8 and every color is opaque sRGB. Appearance can vary across displays, so the numeric HEX, RGB, and rounded HSL strings are the authoritative values.

Generation and locks remain in this page memory. The tool does not upload colors, save history, use accounts, create files, or add results to the URL. It does not build harmonious palettes, choose colors from images, assess contrast, add transparency, or provide a color wheel or picker.

Frequently asked questions

How are the colors generated?

The browser supplies unsigned values through Web Crypto. The generator maps them to opaque 24-bit sRGB colors with rejection sampling and retries duplicate values so every visible color in one batch is unique.

Can I lock a color and reroll the rest?

Yes. Lock any rows you want to keep, then regenerate every unlocked row together. You can also reroll one unlocked row without changing the others.

Why do HEX, RGB, and HSL look different?

They are three text representations of the same opaque sRGB color. HEX and RGB retain the exact integer channels; the displayed HSL degree and percentages are rounded to whole numbers.

Are generated colors uploaded or saved?

No. Colors and locks stay in the current page memory. The tool does not add them to the URL, browser storage, cookies, or analytics.

Sources and method

Related tools