Color problem in Terminal (Mojave)
I believe the odd behavior is due to the fact that Terminal.app does not support True Color (16 million colors), while iTerm2 3.2.9 does. Here the result of a test code from here:



the top panel is from Terminal while the bottom one is from iTerm.