another social rule is that if a program is writing its stdout to a file or pipe, it's expected to turn off colour codes so that users don't end up looking at output like this:
ESC[1;33massets.jsESC[0m
(as far as I know there is almost nothing enforcing this behaviour except that users will be unhappy if you don't do it)