A 10-question quiz: pick the code for a color, or the color for a code
The Color Code Quiz is a practice tool that links what you see on screen to CSS color codes. In "Color → code" you look at a large swatch and choose one of four HEX or RGB codes. In "Code → color" you read a code and choose one of four swatches. A round has 10 questions and no time limit.
Difficulty is set by the range the colors are drawn from and by how far apart the four choices are. Easy uses only the 216 colors whose channels are 00, 33, 66, 99, CC or FF. Normal uses the 4,096 colors that can be shortened to three-digit #RGB. Hard draws from all 16,777,216 colors. The color difference between the four choices (ΔE00) is 20–60, 10–25 and 4–10 respectively. After each answer the correct code is read out as red, green and blue values, with how far your pick was off in each channel. When the round ends you get this round's palette, a way to retry only the questions you missed, and a challenge link to the same 10 questions.
Not a color vision test Your score only reflects practice at reading color codes. The same code can look different depending on screen brightness, night mode and color management settings.
Why practice reading color codes by eye?
Most colors on web pages and in apps are written as numbers such as #3A7BD5 or rgb(58, 123, 213). If you can picture roughly what a code looks like, you can judge whether a value is right before opening a color picker. This quiz lets you make that guess quickly, and when you are wrong it shows which channel you misread.
- Editing CSS or reviewing code: if a button background is
#E4572E, red (E4) is largest and a little green (57) is mixed in, so you can tell from the code alone that it is an orange-tinted red. - Turning a design mockup into code: when the value a designer sent does not match what is on screen, you can tell whether one digit changed or the channel order got swapped.
- Telling similar colors apart: when a design token set has ten grays or ten blues, you have to compare codes to see which is lighter or bluer. Normal and Hard practice exactly this.
- Learning color codes for the first time: Easy uses only steps of 33, so you can first learn anchor points such as "FF is the maximum, 00 is none, 99 is a little above the middle".
How to play
- Choose a question direction. "Color → code" shows a swatch and asks for the code; "Code → color" shows a code and asks for the swatch.
- Choose a code format (HEX, RGB, or mixed per question) and a difficulty (Easy, Normal, Hard). Changing a setting starts a new round with it right away.
- Press one of A–D. On a keyboard, use keys 1–4 or A–D.
- After you answer, you see whether it was right and your points, and the question card breaks the correct code into per-channel bars. If you were wrong, the black tick on a bar is your pick's value, and in "Color → code" the right half of the swatch changes to your picked color.
- Move on with "Next question" (Enter or → on the keyboard). After 10 questions you see your score, accuracy, best streak and this round's palette.
- If you missed any, "Retry missed" replays just those questions with the choices in a different order. "Copy result & link" copies the result together with a link to the same 10 questions.
How to read a HEX code
Split the six digits after # into pairs and read them as red (R), green (G) and blue (B), in that order. Section 5.2 of the W3C CSS Color Module Level 4 defines the first pair as red, with 00 as the minimum and ff (255 in decimal) as the maximum. A two-digit hexadecimal number becomes decimal as first digit × 16 + second digit. A–F stand for 10–15, so D5 is 13 × 16 + 5 = 213.
For a quick read, the first digit is often enough: it moves the value in steps of 16, while the second digit moves it by 15 at most. A first digit of 0–3 means that channel is almost absent, around 8 means about half, and C–F means strong.
| Pair | Decimal | Position in 0–255 | Gray code | Brightness (relative luminance) |
|---|---|---|---|---|
00 | 0 | 0% | #000000 | 0.000 |
33 | 51 | 20% | #333333 | 0.033 |
66 | 102 | 40% | #666666 | 0.133 |
80 | 128 | 50.2% | #808080 | 0.216 |
99 | 153 | 60% | #999999 | 0.319 |
BC | 188 | 73.7% | #BCBCBC | 0.503 |
CC | 204 | 80% | #CCCCCC | 0.604 |
FF | 255 | 100% | #FFFFFF | 1.000 |
The brightness in the table is WCAG 2.2 relative luminance. Code values are gamma-encoded sRGB values, so the halfway value #808080 gives only 21.6% of the light of white. The gray that gives half the light of white is around #BCBCBC.
RGB notation, and three- and eight-digit HEX
rgb(255, 102, 0) writes the same three channels in decimal and is the same color as #FF6600. CSS Color 4 makes the comma-free form rgb(255 102 0) the primary syntax, and still accepts the older comma syntax for web compatibility. The RGB choices in this quiz are shown in the widely used comma syntax.
Three-digit #RGB equals the six-digit form with each digit doubled. As in the CSS Color 4 example, #123 is #112233, not #102030. All 4,096 colors in Normal can be shortened this way. In eight-digit #RRGGBBAA, the last pair is opacity (00 transparent, ff opaque); this quiz only asks about opaque colors.
| Color | HEX | RGB | Brightness |
|---|---|---|---|
| Red | #FF0000 | rgb(255, 0, 0) | 0.213 |
| Green | #00FF00 | rgb(0, 255, 0) | 0.715 |
| Blue | #0000FF | rgb(0, 0, 255) | 0.072 |
| Yellow (red + green) | #FFFF00 | rgb(255, 255, 0) | 0.928 |
| Cyan (green + blue) | #00FFFF | rgb(0, 255, 255) | 0.787 |
| Magenta (red + blue) | #FF00FF | rgb(255, 0, 255) | 0.285 |
| Orange | #FF6600 | rgb(255, 102, 0) | 0.308 |
| White | #FFFFFF | rgb(255, 255, 255) | 1.000 |
| Black | #000000 | rgb(0, 0, 0) | 0.000 |
The three primaries differ so much in brightness because relative luminance is L = 0.2126 R + 0.7152 G + 0.0722 B, where R, G and B are the values after removing gamma. Even with the same FF, green looks almost ten times brighter than blue.
How difficulty and choices are built
For each question, a center color is drawn from the difficulty's range, and four colors are then drawn around it, each by the same method. Each channel can move away from the center by up to ±102 in Easy (two steps of 33), ±51 in Normal (three steps of 11) and ±20 in Hard. A question is used only if all six pairs among the four colors fall inside that level's ΔE00 range; otherwise the colors are drawn again. The correct answer is then picked at random from the four.
If the answer were fixed first and only the wrong choices built around it, the answer would tend to be the middle value or the most typical value of the set, and you could score without looking at the color. Here all four colors come from the same method, so there is no such clue. In test runs of 2,000 rounds (20,000 questions) per level, each position A–D held the answer 24.7–25.5% of the time.
| Difficulty | Colors drawn | Colors | ΔE00 of all pairs among the four choices | Closest pair | Farthest pair |
|---|---|---|---|---|---|
| Easy | Each channel 00·33·66·99·CC·FF | 216 | 20–60 | 23.5 | 51.8 |
| Normal | Each channel 00·11·22·…·FF (#RGB) | 4,096 | 10–25 | 11.2 | 22.5 |
| Hard | Each channel 0–255 | 16,777,216 | 4–10 | 4.4 | 8.9 |
The 216 colors of Easy have six levels per channel (6 × 6 × 6). This is the set that 1990s web design, with 256-color (8-bit) screens in mind, called the "browser-safe palette", the "216 palette" or the "6×6×6 color cube". The values are 51 apart, which makes it easy for beginners to learn anchor points.
Reading ΔE00 in the explanation
The ΔE00 shown beside each choice after you answer is its difference from the correct color. The codes are converted from sRGB to CIELAB with a D65 white point, then compared with the CIEDE2000 formula of the International Commission on Illumination. This tool's calculation matches the 34 test pairs published by Sharma, Wu and Dalal (2005) to four decimal places. 0 means identical, and larger values look more different.
A difference in code numbers is not the same as a difference you can see. The table below changes one channel by exactly 51 (0x33) each time, yet ΔE00 ranges from 3.6 to 25.2, a spread of almost seven times. In dark colors and grays a small change in the numbers is very visible, while adding a little green to pure red is hardly noticeable.
| Before | After | Channel changed | ΔE00 |
|---|---|---|---|
#808080 | #80B380 | green +51 | 25.2 |
#000000 | #003300 | green +51 | 24.6 |
#FFFFFF | #FFFFCC | blue −51 | 16.8 |
#336699 | #666699 | red +51 | 12.7 |
#336699 | #3366CC | blue +51 | 6.3 |
#0000FF | #0033FF | green +51 | 5.4 |
#FF0000 | #FF3300 | green +51 | 3.6 |
One study found that half of observers notice the difference between two side-by-side colors at ΔE00 0.8, and half judge a mismatch unacceptable at 1.8 (Paravina et al. 2015, a study of dental material colors). Even the closest pair in Hard is 4 or more, so the colors are distinguishable side by side, but picking a code from a single swatch is still hard.
Scoring and records
| Difficulty | Correct | Wrong | Max for 10 questions |
|---|---|---|---|
| Easy | +10 | 0 | 140 |
| Normal | +20 | −5 | 240 |
| Hard | +30 | −10 | 340 |
The maximum is the score for answering all 10 correctly and receiving the bonus eight times, from the 3rd to the 10th answer. For example, in Normal, if you get the first three right and miss the fourth, you score 20 + 20 + 25 − 5 = 60. Normal and Hard subtract points for wrong answers, so a score can drop below 0.
At the end of each round, the number of rounds, correct answers, best streak and best score per difficulty are stored only in this browser's storage. Nothing is sent to a server, and "Clear record" erases it. Review rounds of missed questions are not recorded. A challenge link contains only the random seed that generates the questions plus the direction, format and difficulty, so the person who opens it gets the same 10 questions in the same order with the same choice layout.
Tips for answering quickly
- Find the largest channel first. Compare only the first digit of each pair; the largest one sets the direction of the color. Large red leans red, large blue leans blue.
- Two high channels mean a mixed color. Red + green is yellow, green + blue is cyan, red + blue is magenta. Red largest with green in the middle is orange.
- Three similar values mean gray. The smaller the gaps, the lower the saturation; all three large is a light gray, all three small a dark gray.
- Green drives brightness. When comparing brightness, look at green first; blue counts the least.
- In "Code → color", eliminate choices. Remove the swatches whose largest channel is different first, then compare the second-largest channel among those left.
Common mistakes
- Reading 80 as "medium brightness": the value is half, but the light is 21.6%, so
#808080looks darker than you expect. - Expecting colors with a lot of blue to be bright: the brightness of
#0000FFis 0.072, darker even than red (0.213). Colors dominated by blue generally look dark. - Swapping the channel order: CSS is always red, green, blue. Some formats, such as Windows COLORREF, write blue first as 0x00bbggrr, so check the order of values brought in from other programs.
- Padding a three-digit code with zeros:
#4ACis#44AACC, not#40A0C0. - Screen settings that change colors: night mode, blue-light filters, color inversion and low-power mode alter the swatch colors. When comparing close colors, as in Hard, it is more accurate to turn these off.
Limits and cautions
- Swatches paint the code as a standard sRGB color. The same code can look different on a wide-gamut monitor or with different color management, screen brightness and room lighting, and the answer is decided by the code value, not by how it appears on your screen.
- ΔE00 was designed for comparing small color differences. For large differences, as in Easy, the size of the number and the difference you actually perceive may be less proportional.
- The score reflects practice at reading codes and does not assess color vision. If you are worried about telling colors apart, treat a color vision (color-blind) test as a reference only and see an eye doctor if you have difficulty.
- Records are stored only in this browser, so they are not shared with other devices or browsers, and they disappear if you clear site data.
- A challenge link repeats the same calculation in the browser, so if a browser's floating-point results very rarely differ, a different question could appear.
As of The specifications, formulas and study figures in this article were checked on 2026-10-23 against W3C and Microsoft documents and the authors' pages and abstracts.
Sources
- 01W3C. CSS Color Module Level 4 (Candidate Recommendation Draft, 2026-10-22)Section 5.2 HEX notation (six, three and eight digits, #123 = #112233); section 4.1.2 comma syntax
- 02W3C. Web Content Accessibility Guidelines (WCAG) 2.2 — relative luminanceL = 0.2126 R + 0.7152 G + 0.0722 B, gamma removal threshold 0.04045
- 03Stokes M, Anderson M, Chandrasekar S, Motta R. A Standard Default Color Space for the Internet – sRGB (1996)sRGB primaries and D65 white point
- 04Sharma G, Wu W, Dalal EN. The CIEDE2000 color-difference formula: Implementation notes, supplementary test data, and mathematical observations. Color Research & Application 2005;30(1):21–30CIEDE2000 calculation steps and the 34 test pairs
- 05Paravina RD et al. Color difference thresholds in dentistry. J Esthet Restor Dent 2015;27 Suppl 1:S1–950:50% perceptibility threshold ΔE00 0.8, acceptability threshold 1.8
- 06Microsoft Learn. COLORREFWindows GDI color values are 0x00bbggrr (the low byte is red)
- 07Weinman L. The Web-Safe Color Dilemma (web archive copy)Explains that the browser-safe palette, 216 palette and 6×6×6 color cube are the same set of colors, used because of 256-color (8-bit) screens
Frequently asked questions
How do I read a HEX color code?
Split the six digits after # into pairs and read them as red, green and blue in that order. A two-digit hexadecimal number is first digit × 16 + second digit, and A–F are 10–15. #FF6600 is red 255, green 102, blue 0.
Are HEX and RGB different colors?
No. They write the same sRGB color in hexadecimal and in decimal. #FF6600 and rgb(255, 102, 0) are the same color, and CSS Color 4 also lets you write it without commas, as rgb(255 102 0).
What differs between the difficulty levels?
The range colors are drawn from and the color difference between the choices. Easy uses 216 colors with ΔE00 20–60 between the four choices, Normal uses 4,096 colors with 10–25, and Hard uses all 16.8 million colors with 4–10.
What is the ΔE00 shown in the explanation?
It is the difference between two colors measured with the CIEDE2000 formula. 0 means identical and larger values look more different. One study found that half of observers notice about 0.8 side by side, so even Hard's minimum spacing of 4 is distinguishable.
How is the score calculated?
Easy gives +10 for a correct answer and 0 for a wrong one, Normal +20 and −5, Hard +30 and −10 points. From the 3rd correct answer in a row, each correct answer earns 5 more, so the maximums are 140, 240 and 340.
Can I take the same questions as a friend?
After a round ends, press "Copy result & link" to copy the score with a link. Whoever opens it gets the same 10 questions with the same direction, format and difficulty, in the same order and choice layout.
Where are my records stored?
The number of rounds, correct answers, best streak and best score per difficulty stay only in this browser's storage and are never sent to a server. "Clear record" erases them, and review rounds of missed questions are not recorded.
Does a low score mean I have a color vision problem?
No. This quiz is practice at reading color codes and does not assess color vision. Screen settings and room lighting also affect the result. If you are worried about telling colors apart, see an eye doctor for an exam.