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.🌈 In #rrggbb, which colour do the last two digits give? (a) white (b) blue (c) green (d) red
- 2.🌈 Which hex code is magenta? (a) #ff00ff (b) #ffffff (c) #0000ff (d) #ff0000
- 3.🌈 Which colour is rgb(255, 255, 255)? (a) black (b) white (c) red (d) blue
- 4.🌈 Hex digits go 0 to 9, then A to which letter? (a) F (b) G (c) Z (d) J
- 5.🌈 In #rrggbb, which colour do the first two digits give? (a) green (b) blue (c) red (d) black
- 6.🌈 What is the biggest number one colour can have in rgb()? (a) 1000 (b) 255 (c) 99 (d) 100
- 7.🌈 Which colour is #ffff00? (a) red (b) bright green (c) yellow (d) blue
- 8.🌈 Which colour is #0000ff? (a) white (b) black (c) blue (d) bright green
- 9.🌈 Which colour is rgb(0, 0, 255)? (a) black (b) yellow (c) red (d) blue
- 10.🌈 In #560000 the red part is the hex number 56. What is it as a normal number?
- 11.🌈 Which colour of light is strongest in rgb(159, 94, 31)? (a) green (b) blue (c) red
- 12.🌈 Which colour is #ffffff? (a) black (b) red (c) blue (d) white
- 13.🌈 Which hex code is black? (a) #ff0000 (b) #ffffff (c) #ff00ff (d) #000000
- 14.🌈 Which colour is rgb(0, 255, 0)? (a) bright green (b) cyan (c) red (d) magenta
- 15.🌈 In #000031 the blue part is the hex number 31. What is it as a normal number?
- 16.🌈 Which colour is #ff00ff? (a) magenta (b) red (c) cyan (d) black
- 17.🌈 Which hex code is blue? (a) #ff00ff (b) #0000ff (c) #ff0000 (d) #00ffff
- 18.🌈 Which hex code is bright green? (a) #ffffff (b) #ffff00 (c) #0000ff (d) #00ff00
- 19.🌈 Which colour of light is strongest in rgb(27, 50, 174)? (a) green (b) red (c) blue
- 20.🌈 Which colour is #ff0000? (a) black (b) blue (c) red (d) magenta
- 21.🌈 Which colour of light is strongest in rgb(88, 238, 1)? (a) green (b) red (c) blue
- 22.🌈 Which colour of light is strongest in rgb(27, 169, 77)? (a) green (b) blue (c) red
- 23.🌈 Which colour of light is strongest in rgb(240, 5, 65)? (a) green (b) red (c) blue
- 24.🌈 In #0000f8 the blue part is the hex number f8. What is it as a normal number?
- 25.🌈 In #009100 the green part is the hex number 91. What is it as a normal number?
- 26.🌈 Which colour is rgb(0, 0, 0)? (a) black (b) cyan (c) magenta (d) white
- 27.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 2 (b) 4 (c) 6 (d) 3
- 28.🌈 Which hex code is red? (a) #ff0000 (b) #00ffff (c) #ff00ff (d) #000000
- 29.🌈 In #ca0000 the red part is the hex number ca. What is it as a normal number?
- 30.🌈 Which hex code is yellow? (a) #0000ff (b) #ffff00 (c) #000000 (d) #00ff00
- 31.🌈 In #00005c the blue part is the hex number 5c. What is it as a normal number?
- 32.🌈 In #400000 the red part is the hex number 40. What is it as a normal number?
- 33.🌈 Which colour is rgb(255, 0, 255)? (a) cyan (b) yellow (c) bright green (d) magenta
- 34.🌈 Which colour of light is strongest in rgb(250, 54, 121)? (a) red (b) blue (c) green
- 35.🌈 Which colour of light is strongest in rgb(72, 26, 195)? (a) blue (b) green (c) red
- 36.🌈 Which hex code is white? (a) #ffff00 (b) #ffffff (c) #0000ff (d) #00ffff
- 37.🌈 Which hex code is cyan? (a) #00ffff (b) #00ff00 (c) #ff0000 (d) #ffffff
- 38.🌈 Which colour is #00ff00? (a) magenta (b) yellow (c) bright green (d) blue
- 39.🌈 Which colour is rgb(255, 0, 0)? (a) yellow (b) cyan (c) white (d) red
- 40.🌈 Which colour of light is strongest in rgb(242, 118, 10)? (a) red (b) green (c) blue
Answer key
- blue
- #ff00ff
- white
- F
- red
- 255
- yellow
- blue
- blue
- 86
- red
- white
- #000000
- bright green
- 49
- magenta
- #0000ff
- #00ff00
- blue
- red
- green
- green
- red
- 248
- 145
- black
- 3
- #ff0000
- 202
- #ffff00
- 92
- 64
- magenta
- red
- blue
- #ffffff
- #00ffff
- bright green
- red
- red
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids