How about below?
Also, I added an optional argument, which you can use to specify which
chord-note should be colored.
Default is 'first'.
It's possible to switch to 'last'.
Other settings like 'fourth' at own risk:
Ofcourse specifying 'fourth' will result in an error, if any chord has
not enough notes.
\version "2.18.0"
clr =
#(define-music-function (parser location which color music)
((procedure? car) color? ly:music?)
(music-map
(lambda (mus)
(if (music-is-of-type? mus 'event-chord)
(let* ((evt-chrd-nts (event-chord-notes mus)))
(if (> (length evt-chrd-nts) 1)
(let ((first-nh (which evt-chrd-nts)))
#{ \tweak #'color #color #first-nh #})
mus)
mus)
mus))
music))