def METHOD_NAME(self, index):
    if isinstance(self.colours, list):
        try:
            self.layout.colour = self.colours[index]
        except IndexError:
            self.METHOD_NAME(index - 1)
    else:
        logger.error(
            'variable "colours" should be a list, to set a\
                        colour for all layouts, use "foreground".'
        )