One concern I have with this is format() creates a string, which isn't necessarily output; color is a thing of output.
The unix implementation will use the ansi escape sequences, surely, which isn't correct almost anywhere else. Of course, you could choose to not use these special specifiers, and put a note in the documentation explaining what it is, so not a big deal... but I just think it is somewhat wrong to put special control sequences in the middle of a regular string that might be used anywhere.
