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 first two digits give? (a) green (b) black (c) blue (d) red
- 2.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 3 (b) 2 (c) 4 (d) 6
- 3.🌈 Which hex code is black? (a) #000000 (b) #0000ff (c) #ffff00 (d) #00ffff
- 4.🌈 In #rrggbb, which colour do the last two digits give? (a) blue (b) green (c) white (d) red
- 5.🌈 In #00006d the blue part is the hex number 6d. What is it as a normal number?
- 6.🌈 In #00cb00 the green part is the hex number cb. What is it as a normal number?
- 7.🌈 Which colour is rgb(0, 0, 255)? (a) magenta (b) cyan (c) bright green (d) blue
- 8.🌈 In #960000 the red part is the hex number 96. What is it as a normal number?
- 9.🌈 Which colour is #0000ff? (a) blue (b) cyan (c) black (d) white
- 10.🌈 Which hex code is red? (a) #ff00ff (b) #00ff00 (c) #ffffff (d) #ff0000
- 11.🌈 Which hex code is white? (a) #ff0000 (b) #ffffff (c) #000000 (d) #00ff00
- 12.🌈 In #00007d the blue part is the hex number 7d. What is it as a normal number?
- 13.🌈 In #00003d the blue part is the hex number 3d. What is it as a normal number?
- 14.🌈 Which colour is #ff0000? (a) bright green (b) black (c) yellow (d) red
- 15.🌈 In #009100 the green part is the hex number 91. What is it as a normal number?
- 16.🌈 Which colour is #000000? (a) white (b) red (c) bright green (d) black
- 17.🌈 Which colour is rgb(0, 0, 0)? (a) black (b) magenta (c) blue (d) cyan
- 18.🌈 Which colour is rgb(255, 255, 0)? (a) blue (b) cyan (c) yellow (d) white
- 19.🌈 Which colour is rgb(255, 0, 255)? (a) black (b) red (c) bright green (d) magenta
- 20.🌈 Hex digits go 0 to 9, then A to which letter? (a) G (b) F (c) J (d) Z
- 21.🌈 Which colour is rgb(0, 255, 0)? (a) blue (b) magenta (c) bright green (d) white
- 22.🌈 What is the biggest number one colour can have in rgb()? (a) 99 (b) 255 (c) 1000 (d) 100
- 23.🌈 In #0000a0 the blue part is the hex number a0. What is it as a normal number?
- 24.🌈 Which hex code is blue? (a) #00ffff (b) #0000ff (c) #000000 (d) #00ff00
- 25.🌈 Which colour of light is strongest in rgb(175, 96, 88)? (a) green (b) blue (c) red
- 26.🌈 Which colour is rgb(0, 255, 255)? (a) bright green (b) black (c) blue (d) cyan
- 27.🌈 Which colour of light is strongest in rgb(32, 12, 197)? (a) green (b) blue (c) red
- 28.🌈 In #d80000 the red part is the hex number d8. What is it as a normal number?
- 29.🌈 In #0000b8 the blue part is the hex number b8. What is it as a normal number?
- 30.🌈 Which colour of light is strongest in rgb(39, 171, 111)? (a) blue (b) red (c) green
- 31.🌈 Which hex code is cyan? (a) #ff00ff (b) #ff0000 (c) #ffff00 (d) #00ffff
- 32.🌈 Which colour is #00ffff? (a) cyan (b) yellow (c) magenta (d) red
- 33.🌈 Which hex code is bright green? (a) #00ff00 (b) #ff0000 (c) #0000ff (d) #000000
- 34.🌈 Which colour of light is strongest in rgb(150, 79, 54)? (a) red (b) green (c) blue
- 35.🌈 In #a00000 the red part is the hex number a0. What is it as a normal number?
- 36.🌈 Which colour of light is strongest in rgb(34, 209, 29)? (a) blue (b) green (c) red
- 37.🌈 In #000099 the blue part is the hex number 99. What is it as a normal number?
- 38.🌈 Which colour of light is strongest in rgb(212, 52, 136)? (a) green (b) blue (c) red
- 39.🌈 Which colour of light is strongest in rgb(114, 174, 94)? (a) blue (b) green (c) red
- 40.🌈 Which colour of light is strongest in rgb(238, 43, 135)? (a) green (b) red (c) blue
Answer key
- red
- 3
- #000000
- blue
- 109
- 203
- blue
- 150
- blue
- #ff0000
- #ffffff
- 125
- 61
- red
- 145
- black
- black
- yellow
- magenta
- F
- bright green
- 255
- 160
- #0000ff
- red
- cyan
- blue
- 216
- 184
- green
- #00ffff
- cyan
- #00ff00
- red
- 160
- green
- 153
- red
- green
- red
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids