ГСЧ randomness lab

Utilities

Random color

Color and palette for a layout, wallpaper, or mood — with one click.

instant computed locally
#7C3AED
Random color shade 262°
HEX #7C3AED
RGB rgb(124, 58, 237)
HSL hsl(262, 83%, 58%)

Aa On this background, white text is readable — contrast 5.7:1.

Harmony Click on the sample — copy HEX
Complementary — maximum contrast
Similar — calm kinship
Triad — the balance of three
Tetrad — four supports
Palette of 5 colors A separate set, not related to the color above
5 colors · click on the sample to copy
Colors are calculated in the browser using a local CSPRNG — identical RGB channels give 16,777,216 equally probable options. Nothing is sent to the server.

How to choose a color

A random color is not just inspiration. Sometimes you need a 'just different' shade to distinguish test data from live data, choose a background for a card, or see how a combination looks on a real layout. The generator produces an evenly random color from 16.7 million options and immediately shows it in three models.

Next comes the design: the same shade works differently as a background, an accent, and text. That’s why contrast is shown next to the color — you can immediately understand whether it is suitable for a caption.

HEX, RGB, and HSL — what is the difference

HEX and RGB describe the same thing: three channels — red, green, blue — each with 256 values. The only difference is in the notation: #7C3AED or rgb(124, 58, 237). This notation is convenient for code, but inconvenient for humans: it is not clear how to “shift” the hue without changing the brightness.

HSL breaks down color into hue (hue in a circle, 0–360°), saturation (saturation, 0–100%) and lightness (lightness, 0–100%). You can see the logic here: to get a complementary color, just rotate the hue 180°. This is why harmonies are considered in HSL and not RGB.

Harmonies and when to apply them

SchemeHue shiftWhere it fits
Complementary180°button in the background, accent in a calm layout
Similar±30°gradients, illustrations, smooth transitions
Triad120°, 240°three categories of equal weight
Tetrad90°, 180°, 270°rich diagrams, infographics

The 60-30-10 rule helps prevent overloading a layout: sixty percent of the area is the main color, thirty is the supporting color, ten is the accent. Harmony comes from a set from which it is easy to choose these three roles.

Contrast and readability

Color brightness is calculated according to the WCAG formula: channels are converted to linear space, then summed with weights of 0.2126 for red, 0.7152 for green, and 0.0722 for blue. The contrast of two colors is the ratio (L1 + 0,05) / (L2 + 0,05), where L1 is the brightness of the lighter one.

Threshold for regular text — 4,5 : 1 (level AA), for large text — 3:1. The generator immediately selects which text reads better: white or black, and shows the resulting ratio. If the value is below 4.5, the color is suitable for the background of the card, but not for a caption.

A separate nuance: contrast does not take into account color blindness and does not replace testing in the real interface. For important states, duplicate the color with an icon or text.

What to do with the finished palette

  • copy the HEX values and paste them into the theme variables;
  • Check the text contrast against each background, not just the main one;
  • Do not use more than two saturated colors in one block;
  • Save the successful set — it cannot be assembled again.
Frequently Asked Questions
How random is the color?
Each of the three channels is chosen uniformly from 0 to 255 independently of the others — a total of 256³ = 16,777,216 options. The source is a local cryptographic generator, so it has no “favorite” shades.
What does 'contrast 4.5:1' mean?
This is the ratio of the brightness of two colors according to the WCAG formula. A value of 4.5:1 is the minimum for regular text (level AA), 7:1 is level AAA. The higher the ratio, the easier it is to read.
Why are harmonies built in HSL?
In HSL, hue is an angle on the color wheel. A rotation of 180° gives a complementary color, 120° — a vertex of a triad. In RGB, such rotations would have to be calculated using matrices, and the result is harder to predict.
Is it possible to copy the entire palette at once?
Yes: the 'Copy all HEX' button puts five values into the clipboard, one per line. An individual sample is copied by clicking.
Does the color look the same on all screens?
No. Matrices, backlight brightness, and color profiles differ, so saturated shades look different on different monitors. HEX is generally not suitable for printing — you need a CMYK model.
↑↓ navigation Enter to open Esc close