Fix stack overflow when formatting ColorMask

The old implementation of ColorMask relied on itself for formatting,
leading to an infinite recursive loop and eventual stack overflow.
I was working under the assumption that this code is only useful for debugging, so I didn't think to hard about how to avoid the allocation. Your suggestion is definitely better though, I'll update the pull request later!