def METHOD_NAME(text):
    """Example implementation of a gradient function,
    distributes colors over text, accounting for links,
    #memos, @handles, smilies.
    Add it as:
        Regexp Replace
        Regexp:         ^(.*)$
        Replace With:   rainbow(\1)
    To customize it:
     1. Copy this function.
     2. Replace the hex colors in 'gradient' below with your own colors.
     3. Replace 'rainbow' above and below with something more fitting :3
    You shouldn't enable the 'exclude links and smilies' option, this function
    already does that!
    There's lots of implementations of this that predate mine,
    see: https://paste.0xfc.de/?e60df5a155e93583#AmcgN9cRnCcBycmVMvw6KJ1YLKPXGbaSzZLbgAhoNCQD
            ^ There's more useful info here too :3c
    """
    # Values of 'gradient' can be any amount of hex/RGB colors.
    gradient = [
        "#ff0000",
        "#ff8000",
        "#ffff00",
        "#80ff00",
        "#00ff00",
        "#00ff80",
        "#00ffff",
        "#0080ff",
        "#0000ff",
        "#8000ff",
        "#ff00ff",
        "#ff0080",
    ]
    # Set base distribution of colors over text,
    # stored as list of lists.
    colors_and_positions = []
    for color_pos, color in enumerate(gradient):
        ratio = len(text) / len(gradient)  # To account for text length.
        colors_and_positions.append([color, round(color_pos * ratio)])
    # Iterate through match objects representing all links/smilies in text,
    # if a color tag is going to be placed within it,
    # move its position to after the link/smilies/thingy.
    match_chain = itertools.chain(
        re.finditer(_urlre, text),
        re.finditer(_smilere, text),
        re.finditer(_memore, text),
        re.finditer(_handlere, text),
        re.finditer(_alternian_begin, text),
        re.finditer(_alternian_end, text),
    )
    for match in match_chain:
        for color_and_position in colors_and_positions:
            # color_and_position[1] is pos
            if (
                color_and_position[1] >= match.start()
                and color_and_position[1] <= match.end()
            ):
                # Move to 1 character after link.
                color_and_position[1] = match.end() + 1
    # Iterate through characters in text and write them to the output,
    # if a color tag should be placed, add it before the character.
    output = ""
    for char_pos, char in enumerate(text):
        # Add color if at position.
        for color_and_position in colors_and_positions:
            # color_and_position[0] is color
            # color_and_position[1] is pos
            if char_pos == color_and_position[1]:
                # Add closing bracket for previous color.
                output += "</c>"
                # Add color
                output += f"<c={color_and_position[0]}>"
        # Add character.
        output += char
    return output