Here is an example implementation of coloring SVG output notation from verovio. Diatonic pitch-classes are given different colors, and other graphical markup such as stems, ties, and beams are colored by pitch-class as well, using a mixture of CSS and javascript. You can edit the music in the text box on the demo page to change the colored music notation dynamically. Also try copy/pasting other Humdrum data into the text box.

Also see the simpler coloring method, which only uses CSS.