Terminal.app magically changing color values
In order to get the right color scheme the background needs to be explicitly declared inside LSCOLOR (gnu) or LS_COLOR (linux) and match the non-ANSI one set in your Terminal.app (i.e. Window > Background > Color and Effects).

So, something like LSCOLORS=eadafafacafafacacaeaea would work while something like LSCOLORS=exdxfxfxcxfxfxcxcxexex wouldn't.