RandALL

Random color generator

One tap for a color, its HEX, RGB and HSL codes, and a palette to go with it.

Any · 1 in 16,777,216

HEX

Tap Randomize, or press Space

Options

ModeEvery one of the 16,777,216 colors
ContrastWCAG 2 level AA asks 4.5:1 for normal text
AaWhite text
?
AaBlack text
?
RecentTap one to bring it back

What it does

Tap Randomize and this random color generator picks one of the 16,777,216 colors a screen can show, each equally likely, with its HEX, RGB and HSL codes. It also builds a five-color palette around it and checks how text reads on it. Your device’s secure random generator picks the color, and nothing leaves the page.

How to use it

  1. Tap Randomize, or press Space. The new color floods the swatch.
  2. Tap a code to copy it: HEX, RGB or HSL, ready to paste into CSS.
  3. Tap a palette color to put it on the swatch and copy its HEX.
  4. Tap Share to send a link that opens the same color.
Put this color on your own site

Paste this where you want it to appear: a class page, a blog post, a stream overlay. It is free to use, with the link under it left in place.

What people use it for

A design starting point

Stuck on a blank mood board? Draw until one feels right and take its palette as your first five colors.

Art prompts

Draw three colors and paint or sketch something using only those. Pastel keeps it soft, Vivid keeps it loud.

A team color

Let each team draw its color for bibs, slides or the group chat. Nobody got the ugly one on purpose.

A theme for the day

Draw a color in the morning, then wear it, spot it on your walk or cook something that color.

Checking text on a color

Every color shows its contrast with white and with black text, and whether each passes WCAG AA.

HEX, RGB and HSL, explained

The three codes are three ways of writing the same color. Here is the purple this page is painted in, #C66BFF:

CodeWritten that way
HEX#C66BFF
RGBrgb(198, 107, 255)
HSLhsl(277, 100%, 71%)

RGB gives the red, green and blue light in the color, each from 0 to 255: red 198, green 107, blue 255.

HEX is the same three numbers in base 16, two digits each, from 00 to FF. C6 is 12 × 16 + 6 = 198, 6B is 6 × 16 + 11 = 107 and FF is 15 × 16 + 15 = 255. That makes 256 × 256 × 256 = 16,777,216 colors, every code from #000000 (black) to #FFFFFF (white).

HSL describes a color the way people talk about one: which hue, how strong, how light. #C66BFF sits at hue 277° on the color wheel (0° is red, 120° green, 240° blue), with saturation 100% and lightness 71%. Lightness 0% is always black and 100% always white, whatever the hue, which is why the modes here are defined in HSL.

Contrast follows WCAG 2. Each channel is turned into linear light and weighted (21.26% red, 71.52% green, 7.22% blue) into a relative luminance from 0 to 1. The ratio is (lighter + 0.05) ÷ (darker + 0.05), from 1:1 to 21:1. #C66BFF scores 6.94:1 with black text and 3.02:1 with white. Level AA asks 4.5:1 for normal text and 3:1 for large text, so black text passes on it and white text passes only when large.

The palette is built the way the RandALL app builds it: the color and its neighbours 15° and 30° either side on the hue wheel, at the same saturation and brightness. For #C66BFF that is #7C6BFF, #A16BFF, #C66BFF, #EB6BFF, #FF6BEE. A near grey has no hue to walk round, so it gets five brightness steps 15% apart instead.

The four modes, exactly

Each mode is a fixed set of colors, chosen by the HSL values the readout shows. Every color in a mode is equally likely, and no color outside it can come up.

ModeColors in itShare of all
Any16,777,216100.00%
Pastel752,0224.48%
Vivid3,012,34817.95%
Dark968,0165.77%
  • Any: every color from #000000 to #FFFFFF.
  • Pastel: lightness 75% to 90%, saturation 50% or more.
  • Vivid: saturation 80% or more, lightness 40% to 60%.
  • Dark: lightness 25% or less, saturation 30% or more.

The rules use the exact values, before rounding. A color whose lightness is 74.9% shows as 75% but stays out of Pastel, never the other way round.

How it picks

The same way the RandALL app does: the color first, the show after.

  1. The color is drawn first. One whole number from 0 to 16,777,215 is drawn with crypto.getRandomValues, with rejection sampling so that no number gets a rounding edge, and split into red, green and blue. In Any mode every color has the same 1 in 16,777,216 chance.
  2. Other modes draw again until the color fits. Pastel, Vivid and Dark keep drawing from all the colors until one falls inside the mode. That keeps every color inside it equally likely.
  3. Then the swatch fills. The drop, the flood, the rolling digits and the palette only show the color that was already drawn.
  4. The palette is worked out, not drawn. The four neighbours come from the drawn color by turning its hue, so the same color always gets the same palette.

Tested. In 160,000 test draws in Any mode, every HEX digit and every channel value came up as often as chance allows (chi-square test), and Pastel, Vivid and Dark draws matched the exact makeup of their sets without ever breaking their rules. A scan of all 16,777,216 colors gives the counts above, the palette for #BEE76D matches the app’s, and contrast ratios match published values (black on white 21:1, #777777 on white 4.47:1).

How every RandALL tool picks

All 19 web tools

Questions

Is this random color generator really random?

Yes. Each color is drawn with crypto.getRandomValues, the random source browsers use for security, before the swatch moves. In Any mode all 16,777,216 colors have the same chance.

How many colors are there?

16,777,216. With 256 levels each of red, green and blue, 256 × 256 × 256 colors can be written in HEX, from #000000 to #FFFFFF. Any mode can draw every one of them.

How do I get a random pastel color?

Pick Pastel under Mode. It draws only colors with an HSL lightness of 75% to 90% and a saturation of 50% or more. There are 752,022 of them, each equally likely.

How does the random color palette generator pick the palette?

It takes the drawn color and turns its hue 15° and 30° each way, keeping saturation and brightness, as the RandALL app does. Five neighbours on the color wheel sit together as one family. Tap Palette to copy all five.

What do the contrast numbers mean?

They are WCAG 2 contrast ratios between the color and white or black text, from 1:1 to 21:1. Level AA asks at least 4.5:1 for normal text and 3:1 for large text. The swatch writes its Aa in whichever reads better.

Can I share a color or open one by its code?

Yes. The color rides in the address after the #, as in /random-color-generator/#C66BFF. Tap Share to send it, or type any HEX code there and the page opens on it.

Can I get a random color name instead of a code?

Yes. Spin the color wheel spinner: ten everyday colors from red to black, each with the same chance.

RandALL app icon

Take it with you

RandALL for iPhone has 25 tools in one app: wheels and teams, real 3D dice, random alarms, Finger Picker and more. It works offline.

Your first 24 hours are free, with every tool. After that, subscribe or buy the lifetime unlock once. Family Sharing included.

Get it on the App Store

iPhone only for now. These web tools are yours to keep using.

QR code that opens RandALL on the App Store
Scan with your iPhone
All tools

Lists

Spin the WheelYour list on a wheel Random Name PickerDraw a few names List RandomizerWho goes first? Bracket GeneratorLast one standing Team GeneratorSplit a list into groups

Games

Coin FlipHeads or tails? Dice RollerAny dice, any sides Random Number GeneratorPick a number, any range Random Card GeneratorDraw a card Lottery Number GeneratorPick X of Y Rock Paper ScissorsRock, paper or scissors Spin the BottleRandom direction Tarot Card ReadingOne card, or three

Generators

Random Country GeneratorSpin the globe Random Color GeneratorA color and its palette Random Date GeneratorRandom date and time Fortune CookieOpen a cookie Random TimerNobody knows when it ends Random Animal GeneratorRandom species
RandALL for iPhone25 tools in one app. Works offline.