CSS Worksheet: Hex and RGB Colours
Code tip (Red, green, blue): rgb(red, green, blue): each from 0 to 255. #rrggbb: the same three numbers in hex. Hex digits: 0–9, then a = 10, b = 11, c = 12, d = 13, e = 14, f = 15. A pair = 16 × first digit + second digit: ff = 16 × 15 + 15 = 255.
NameDateTime takenScore ___ / 40
- 1.🌈 Which hex code is blue? (a) #ffff00 (b) #0000ff (c) #ff0000 (d) #ff00ff
- 2.🌈 In #rrggbb, which colour do the last two digits give? (a) green (b) blue (c) white (d) red
- 3.🌈 Which colour of light is strongest in rgb(95, 5, 196)? (a) red (b) green (c) blue
- 4.🌈 Which colour of light is strongest in rgb(4, 254, 122)? (a) green (b) red (c) blue
- 5.🌈 In #rrggbb, which colour do the first two digits give? (a) red (b) black (c) green (d) blue
- 6.🌈 Which colour is #ff0000? (a) magenta (b) black (c) red (d) bright green
- 7.🌈 In #0000f8 the blue part is the hex number f8. What is it as a normal number?
- 8.🌈 Which hex code is white? (a) #ffff00 (b) #ffffff (c) #00ff00 (d) #ff0000
- 9.🌈 In #000044 the blue part is the hex number 44. What is it as a normal number?
- 10.🌈 Which hex code is black? (a) #ffff00 (b) #ff00ff (c) #000000 (d) #ffffff
- 11.🌈 Which colour is rgb(0, 255, 0)? (a) black (b) blue (c) magenta (d) bright green
- 12.🌈 Which colour is #ffffff? (a) bright green (b) white (c) yellow (d) red
- 13.🌈 Which hex code is yellow? (a) #000000 (b) #ffff00 (c) #ffffff (d) #ff0000
- 14.🌈 Which colour of light is strongest in rgb(234, 121, 82)? (a) green (b) blue (c) red
- 15.🌈 In #800000 the red part is the hex number 80. What is it as a normal number?
- 16.🌈 In #fe0000 the red part is the hex number fe. What is it as a normal number?
- 17.🌈 In #e30000 the red part is the hex number e3. What is it as a normal number?
- 18.🌈 Hex digits go 0 to 9, then A to which letter? (a) F (b) G (c) J (d) Z
- 19.🌈 Which hex code is magenta? (a) #00ffff (b) #000000 (c) #ff00ff (d) #ffffff
- 20.🌈 Which colour is #00ff00? (a) magenta (b) bright green (c) cyan (d) red
- 21.🌈 Which colour is rgb(0, 255, 255)? (a) cyan (b) red (c) black (d) blue
- 22.🌈 What is the biggest number one colour can have in rgb()? (a) 99 (b) 255 (c) 100 (d) 1000
- 23.🌈 In #005200 the green part is the hex number 52. What is it as a normal number?
- 24.🌈 Which colour is rgb(255, 0, 0)? (a) bright green (b) blue (c) cyan (d) red
- 25.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 4 (b) 2 (c) 3 (d) 6
- 26.🌈 In #a70000 the red part is the hex number a7. What is it as a normal number?
- 27.🌈 Which colour of light is strongest in rgb(250, 119, 55)? (a) green (b) red (c) blue
- 28.🌈 Which colour is #00ffff? (a) red (b) yellow (c) black (d) cyan
- 29.🌈 In #aa0000 the red part is the hex number aa. What is it as a normal number?
- 30.🌈 Which colour of light is strongest in rgb(52, 4, 159)? (a) green (b) red (c) blue
- 31.🌈 Which colour is #ff00ff? (a) red (b) bright green (c) magenta (d) cyan
- 32.🌈 Which colour is #000000? (a) black (b) cyan (c) red (d) yellow
- 33.🌈 Which hex code is red? (a) #00ff00 (b) #ff00ff (c) #ff0000 (d) #000000
- 34.🌈 Which colour of light is strongest in rgb(227, 106, 13)? (a) blue (b) red (c) green
- 35.🌈 Which colour is #ffff00? (a) red (b) bright green (c) blue (d) yellow
- 36.🌈 In #560000 the red part is the hex number 56. What is it as a normal number?
- 37.🌈 Which colour is rgb(0, 0, 255)? (a) red (b) white (c) blue (d) yellow
- 38.🌈 Which colour of light is strongest in rgb(237, 58, 76)? (a) green (b) blue (c) red
- 39.🌈 Which colour of light is strongest in rgb(30, 21, 190)? (a) red (b) green (c) blue
- 40.🌈 Which colour is #0000ff? (a) magenta (b) blue (c) black (d) yellow
Answer key
- #0000ff
- blue
- blue
- green
- red
- red
- 248
- #ffffff
- 68
- #000000
- bright green
- white
- #ffff00
- red
- 128
- 254
- 227
- F
- #ff00ff
- bright green
- cyan
- 255
- 82
- red
- 3
- 167
- red
- cyan
- 170
- blue
- magenta
- black
- #ff0000
- red
- yellow
- 86
- blue
- red
- blue
- blue
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids