<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def replace_color(self, before, after):
 """ Replaces a color on a surface with another one. :param before: Change all pixels with this color :param after: To that color :type before: tuple :type after: tuple """

        #TODO: find out if this actually works
        #((self.matrix[x][y] = after for y in range(self.height) if self.matrix[x][y] == before) for x in range(self.width))
        for x in range(self.width):
            for y in range(self.height):
                if self.matrix[x][y] == before:
                    self.matrix[x][y] = after