Color detection for threads / woods

A solution for the defined problem could indeed be a smartphone app. But I would use a clip-on microscope. They could magnify 60x and the optical quality is not important. A little blurriness only helps out. Perhaps a 3D printed thread holder with a built in light and white background plate as a clip-on to the clip-on microscope.