<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _SetColour(self, value_list):
 """Sets row's colour attributes to a list of values in terminal.SGR."""

        if value_list is None:
            self._color = None
            return
        colors = []
        for color in value_list:
            if color in terminal.SGR:
                colors.append(color)
            elif color in terminal.FG_COLOR_WORDS:
                colors += terminal.FG_COLOR_WORDS[color]
            elif color in terminal.BG_COLOR_WORDS:
                colors += terminal.BG_COLOR_WORDS[color]
            else:
                raise ValueError("Invalid colour specification.")
        self._color = list(set(colors))