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.
Roll the dice
Press Space or Enter, or click Roll. Total —.
Result
Nothing rolled yet
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.
- MDN — Crypto.getRandomValues() — the API this site draws from, and its wording that the values are “cryptographically strong random values”.
- D&D Beyond — Basic Rules: Using Ability Scores — the advantage and disadvantage rule quoted on the DnD page: “you roll a second d20 … Use the higher of the two rolls if you have advantage, and use the lower roll if you have disadvantage.”
- D&D Beyond — Basic Rules: Step-by-Step Characters — the ability-score method quoted on the DnD page: “Roll four 6-sided dice and record the total of the highest three dice … Do this five more times, so that you have six numbers.”
- W3C — WCAG 2.2 relative luminance and contrast ratio — the luminance formula 0.2126R + 0.7152G + 0.0722B and the ratio (L1 + 0.05) / (L2 + 0.05) used to pick every label colour on the colour dice.
- Wikipedia — Dice notation — the NdM convention and the keep/drop and exploding suffixes this roller implements.
- Wikipedia — Yahtzee — the five-dice game and the note that Yahtzee is a trademark of Hasbro; this site is not affiliated with Hasbro and uses no Hasbro artwork or score sheet.
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.