In solutions, the indicators are present in two forms, HIn and In-. and these two forms have distinct colors. Now, in solution there are two reactions which can occur, depending on whether an acid or a base is added in the solution.
If acid is added to the solution, more HIn is present and this changes the color of the solution as per the form HIn.
If the base is added, more In- is present, which changes the color of the solution to that of In-.
Regards