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.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 3 (b) 6 (c) 2 (d) 4
- 2.🌈 In #390000 the red part is the hex number 39. What is it as a normal number?
- 3.🌈 Which colour is rgb(255, 255, 0)? (a) red (b) blue (c) cyan (d) yellow
- 4.🌈 Which colour is #ffff00? (a) red (b) yellow (c) white (d) magenta
- 5.🌈 Which colour of light is strongest in rgb(114, 20, 173)? (a) blue (b) red (c) green
- 6.🌈 Which hex code is white? (a) #0000ff (b) #00ffff (c) #ffffff (d) #000000
- 7.🌈 Which colour of light is strongest in rgb(91, 80, 168)? (a) blue (b) green (c) red
- 8.🌈 Which hex code is red? (a) #0000ff (b) #ff0000 (c) #000000 (d) #ff00ff
- 9.🌈 Which hex code is blue? (a) #00ffff (b) #000000 (c) #ff00ff (d) #0000ff
- 10.🌈 In #rrggbb, which colour do the first two digits give? (a) blue (b) black (c) red (d) green
- 11.🌈 In #00cc00 the green part is the hex number cc. What is it as a normal number?
- 12.🌈 Which colour of light is strongest in rgb(34, 172, 23)? (a) green (b) blue (c) red
- 13.🌈 Which colour of light is strongest in rgb(61, 174, 37)? (a) green (b) red (c) blue
- 14.🌈 Which colour is #ffffff? (a) red (b) magenta (c) bright green (d) white
- 15.🌈 Which colour is rgb(0, 0, 0)? (a) bright green (b) black (c) red (d) yellow
- 16.🌈 Which colour is #0000ff? (a) red (b) blue (c) white (d) yellow
- 17.🌈 Which hex code is black? (a) #000000 (b) #0000ff (c) #00ff00 (d) #ff0000
- 18.🌈 In #ac0000 the red part is the hex number ac. What is it as a normal number?
- 19.🌈 Which colour is rgb(0, 255, 255)? (a) black (b) magenta (c) red (d) cyan
- 20.🌈 Which colour is #ff0000? (a) white (b) red (c) magenta (d) cyan
- 21.🌈 Which colour is #000000? (a) white (b) red (c) black (d) blue
- 22.🌈 Which colour is #00ff00? (a) magenta (b) cyan (c) yellow (d) bright green
- 23.🌈 Which colour is rgb(255, 255, 255)? (a) red (b) white (c) blue (d) black
- 24.🌈 What is the biggest number one colour can have in rgb()? (a) 99 (b) 255 (c) 1000 (d) 100
- 25.🌈 In #000055 the blue part is the hex number 55. What is it as a normal number?
- 26.🌈 Which colour is rgb(255, 0, 255)? (a) bright green (b) cyan (c) yellow (d) magenta
- 27.🌈 Which colour is #00ffff? (a) black (b) white (c) bright green (d) cyan
- 28.🌈 Which colour of light is strongest in rgb(27, 5, 160)? (a) blue (b) red (c) green
- 29.🌈 In #rrggbb, which colour do the last two digits give? (a) white (b) green (c) blue (d) red
- 30.🌈 Which colour of light is strongest in rgb(80, 27, 227)? (a) green (b) red (c) blue
- 31.🌈 Which colour of light is strongest in rgb(199, 67, 12)? (a) red (b) green (c) blue
- 32.🌈 Which colour of light is strongest in rgb(43, 90, 188)? (a) red (b) green (c) blue
- 33.🌈 Which colour of light is strongest in rgb(39, 9, 226)? (a) blue (b) green (c) red
- 34.🌈 In #001c00 the green part is the hex number 1c. What is it as a normal number?
- 35.🌈 Which hex code is magenta? (a) #000000 (b) #00ff00 (c) #ffff00 (d) #ff00ff
- 36.🌈 In #c30000 the red part is the hex number c3. What is it as a normal number?
- 37.🌈 In #0000b3 the blue part is the hex number b3. What is it as a normal number?
- 38.🌈 Which colour of light is strongest in rgb(23, 29, 154)? (a) blue (b) green (c) red
- 39.🌈 In #000015 the blue part is the hex number 15. What is it as a normal number?
- 40.🌈 Which colour of light is strongest in rgb(178, 118, 126)? (a) green (b) red (c) blue
Answer key
- 3
- 57
- yellow
- yellow
- blue
- #ffffff
- blue
- #ff0000
- #0000ff
- red
- 204
- green
- green
- white
- black
- blue
- #000000
- 172
- cyan
- red
- black
- bright green
- white
- 255
- 85
- magenta
- cyan
- blue
- blue
- blue
- red
- blue
- blue
- 28
- #ff00ff
- 195
- 179
- blue
- 21
- red
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids