Weak organic acids or bases that change colour depending on pH of a solution are called

These are called indicators.