Random colour · six dice · name, hex and shape

Color Dice Roller — Six Colors With Names and Shapes

Roll a colour die and read the result three ways: a name, a hex code and a shape. The shape is there so the roll still works in greyscale and for a colour-blind player.

Six coloursName and hexShape as a second cueWCAG-checked labelsNo sign-in

Roll the dice

circle

Press Space or Enter, or click Roll. Total —.

Result

Nothing rolled yet

Exact mean 3.5 · range 1–6

Outlined bars are the exact theoretical chance of each total. Filled bars are this session’s rolls.
1 2 3 4 5 6

Theoretical · This session (0 rolls)

The six colour dice

  • Red#d7263dcircle
  • Orange#f08700triangle
  • Yellow#f4d35esquare
  • Green#2a9d5cdiamond
  • Blue#1d6fb8star
  • Purple#7a4fd0hexagon

Each die carries a name, a hex value and a shape, so the roll is readable in greyscale and for a colour-blind player. The label colour is chosen by WCAG contrast, and a unit test checks every fill.

Why each colour die carries a shape and a name

A colour roller that shows only a coloured square is unreadable for roughly one person in twelve. Red and green are the classic confusion, but blue and purple, and orange and yellow, are also hard to separate for some viewers, and a printed page or a greyscale screenshot removes hue altogether. So each of the six dice on this page is identified three ways at once: a name, a hex value, and a shape — a circle, triangle, square, diamond, star or hexagon.

That is the principle called double encoding: never let colour be the only channel that carries information. If the roll lands on the blue die, the result reads “Blue”, prints `#1d6fb8`, and draws a star, so a colour-blind player, a screen reader and a black-and-white printout all get the same answer. The shape is not a decoration; it is the roll.

The colour is also not a palette recommendation. Six random colours are six starting points, and a good palette needs contrast and proportion that a single die cannot see. Use the roll to break a tie or to pick a starting accent, then check the pair you intend to ship with a contrast tool.

Contrast, and the number that decides the label colour

Every label on a colour die is drawn in whichever of black and white scores higher on the WCAG contrast ratio against that die’s fill. The ratio is computed from the relative luminance of the two colours, `(L1 + 0.05) / (L2 + 0.05)`, where luminance is `0.2126R + 0.7152G + 0.0722B` over the sRGB-linearised channels. Black on white is 21:1; the AA minimum for normal text is 4.5:1.

That is why the yellow die takes a dark label and the blue die takes a white one, without anyone hand-picking per colour. The unit test recomputes a ratio by hand and asserts that the chosen label wins, so a colour added later cannot quietly ship an unreadable label. The six fills are also chosen to sit at clearly different luminances, so they remain distinguishable in greyscale as well as by hue.

If you are choosing a colour to sit behind text, the number to check is contrast, not taste. WCAG 2.2 asks for 4.5:1 for normal-size text and 3:1 for large text; test the specific pair you intend to use rather than a colour in isolation.

Picking a colour without regretting it

A random colour is a good first move and a bad final answer. Use the die to choose the first accent for a chart, a game token or a child’s drawing, then look at it against the colour it will actually sit next to. Two pleasant colours can be muddy together, and the die cannot see your layout.

The hex values on this page are lowercase, six digits, no shorthand — the form that survives copy-paste into CSS, a design tool or a message. The result panel prints the name, the hex code and the shape cue, so the roll is recorded in a form you can act on rather than a colour you have to match by eye. The draw itself is the same crypto.getRandomValues() sampler as every other die here, so each of the six colours has a 1 in 6 chance, shown as 16.7% in the probability chart.

Questions this page answers

How many colours are on the die?

Six: red, orange, yellow, green, blue and purple. Each has a name, a hex value and a shape, and each has a 1 in 6 chance, or 16.7%, which the probability chart shows.

Why does each colour have a shape?

So the roll does not depend on colour alone. Red and green, and blue and purple, are hard to separate for some viewers, and a greyscale printout removes hue entirely. The shape is a second, independent channel that always identifies the result.

How is the label colour chosen?

Each label is drawn in whichever of black and white has the higher WCAG contrast ratio against the die’s fill, computed from relative luminance. That keeps the label on yellow readable without hand-picking a colour per die, and a unit test checks the choice.

Can I roll a specific colour or weight one?

The dice are equally likely, which is what a fair roll means. If you need a specific colour, use the result as a starting point and copy the hex value, or type an expression such as 2d6 to roll two colours at once.

Is a random colour a good palette?

No. One random colour is a starting point; a palette needs contrast and proportion, which a die cannot see. Use the roll for the first accent, then test the pair you intend to ship with a contrast tool.

Sources, and what was actually fetched

Every figure on this site that is not arithmetic comes from one of these pages, read while this build was made. Where a source could not be reached, the page says so instead of pretending.

Put this dice roller on your own page

Embed the dice roller

Copy the snippet into any page. The widget is free, needs no key, and sends nothing until a visitor actually rolls.

Open the widget view

A dice roller is a random-number generator, not a referee. The faces are equally likely and the probability chart is arithmetic on your expression; the game rules quoted on the DnD and five-dice pages belong to their publishers, and the sources are linked above. Nothing you type is uploaded, and nothing is remembered after you close the tab except the expression this browser saved for you.