Generates matrix that describes which blocks should be coloured.

        Arguments:
          hash_bytes - List of hash byte values for which the identicon is being
          generated. Each element of the list should be an integer from 0 to
          255.

        Returns:
          List of rows, where each element in a row is boolean. True means the
          foreground colour should be used, False means a background colour
          should be used.

def _generate_matrix(self, hash_bytes):
        """
        Generates matrix that describes which blocks should be coloured.

        Arguments:
          hash_bytes - List of hash byte values for which the identicon is being
          generated. Each element of the list should be an integer from 0 to
          255.

        Returns:
          List of rows, where each element in a row is boolean. True means the
          foreground colour should be used, False means a background colour
          should be used.
        """

        # Since the identicon needs to be symmetric, we'll need to work on half
        # the columns (rounded-up), and reflect where necessary.
        half_columns = self.columns // 2 + self.columns % 2
        cells = self.rows * half_columns

        # Initialise the matrix (list of rows) that will be returned.
        matrix = [[False] * self.columns for _ in range(self.rows)]

        # Process the cells one by one.
        for cell in range(cells):

            # If the bit from hash correpsonding to this cell is 1, mark the
            # cell as foreground one. Do not use first byte (since that one is
            # used for determining the foreground colour.
            if self._get_bit(cell, hash_bytes[1:]):

                # Determine the cell coordinates in matrix.
                column = cell // self.columns
                row = cell % self.rows

                # Mark the cell and its reflection. Central column may get
                # marked twice, but we don't care.
                matrix[row][column] = True
                matrix[row][self.columns - column - 1] = True

        return matrix