I am using the code I posted as an answer to this question to display hidden characters in an NSTextView as bullets.
I am coloring the bullets gray with the addTemporaryAttributes:forCharacterRange: method of NSLayoutManager. Each range is of length 1 and colors a single bullet. (Most of the same text I am using has relatively few adjacent hidden characters, although this is an optimization I am planning to make in the future.)
This change has many adverse effects. Scrolling the text view becomes slow and jerky, especially for text with many hidden characters. How can I color parts of the text without incurring an unacceptable performance hit?