Is it possible to give figured bass digits different colours?

See pic. I have already coloured the note-heads according to whether the dissonances which they represent are primary or secondary. (Simply put, primary dissonances need some kind of preparation in 18th-century thoroughbass theory; while secondary dissonances may enter freely.) Is it possible to color the figured bass digits accordingly?

Not in Dorico: you’ll have to edit the characters in a drawing package like Illustrator, Inkscape, Graphic, or Affinity Designer (though the latter can mess things up a bit).