Optical detection of resistor colour bands