Technology and society · GCSE · OCR J277 1.6.1, AQA 8525 3.8, Edexcel 1CP2 5.1.1 · about 20 min
Who is shut out of technology, designing for disability, and measuring colour contrast.
[1 mark]What is the digital divide?
[1 mark]Why does the digital divide matter more now than 20 years ago?
[1 mark]Why is "errors are shown in red" a problem?
[1 mark]Which helps a screen reader user most?
[1 mark]The accepted minimum contrast ratio for normal text is:
Using the provided luminance, write contrast(a, b) returning the contrast ratio of two colours. For each (name, foreground, background) in pairs, print <name>: <ratio> pass if the ratio is 4.5 or more, or <name>: <ratio> FAIL if not, with the ratio rounded to 1 decimal place. At the end print failed: <n>, and set the LED to the foreground colour of the first pair that passes.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
def luminance(rgb):
"""How bright a colour looks, from 0 (black) to 1 (white)."""
out = []
for value in rgb:
v = value / 255
out.append(v / 12.92 if v <= 0.03928 else ((v + 0.055) / 1.055) ** 2.4)
return 0.2126 * out[0] + 0.7152 * out[1] + 0.0722 * out[2]
# name, foreground, background
pairs = [
("grey on white", (150, 150, 150), (255, 255, 255)),
("navy on white", (0, 40, 120), (255, 255, 255)),
("yellow on white", (255, 220, 0), (255, 255, 255)),
("white on navy", (255, 255, 255), (0, 40, 120)),
]Plan your program here, then type it in and press Run.