    def paint(self, text, x, y, colour=7, attr=0, bg=0, transparent=False,
              colour_map=None):
        """
        Paint multi-colour text at the defined location.

        :param text: The (single line) text to be printed.
        :param x: The column (x coord) for the start of the text.
        :param y: The line (y coord) for the start of the text.
        :param colour: The default colour of the text to be displayed.
        :param attr: The default cell attribute of the text to be displayed.
        :param bg: The default background colour of the text to be displayed.
        :param transparent: Whether to print spaces or not, thus giving a
            transparent effect.
        :param colour_map: Colour/attribute list for multi-colour text.

        The colours and attributes are the COLOUR_xxx and A_yyy constants
        defined in the Screen class.
        colour_map is a list of tuples (foreground, attribute, background) that
        must be the same length as the passed in text (or None if no mapping is
        required).
        """
        if colour_map is None:
            self.print_at(text, x, y, colour, attr, bg, transparent)
        else:
            offset = next_offset = 0
            current = ""
            for c, m in zip_longest(str(text), colour_map):
                if m:
                    if len(current) > 0:
                        self.print_at(current, x + offset, y, colour, attr, bg, transparent)
                        offset = next_offset
                        current = ""
                    if len(m) > 0 and m[0] is not None:
                        colour = m[0]
                    if len(m) > 1 and m[1] is not None:
                        attr = m[1]
                    if len(m) > 2 and m[2] is not None:
                        bg = m[2]
                if c:
                    current += c
                    next_offset += wcwidth(c) if ord(c) >= 256 else 1
            if len(current) > 0:
                self.print_at(current, x + offset, y, colour, attr, bg, transparent)
Paint multi-colour text at the defined location.

:param text: The (single line) text to be printed.
:param x: The column (x coord) for the start of the text.
:param y: The line (y coord) for the start of the text.
:param colour: The default colour of the text to be displayed.
:param attr: The default cell attribute of the text to be displayed.
:param bg: The default background colour of the text to be displayed.
:param transparent: Whether to print spaces or not, thus giving a
transparent effect.
:param colour_map: Colour/attribute list for multi-colour text.

The colours and attributes are the COLOUR_xxx and A_yyy constants
defined in the Screen class.
colour_map is a list of tuples (foreground, attribute, background) that
must be the same length as the passed in text (or None if no mapping is
required).
asciimatics/screen.py