def METHOD_NAME(fctx):
    # The script is usually rendered using multiple prosesses so we need to have the
    # same sequence of random numbers in all processes.
    random.seed(fctx.get_editor_value("Random Seed"))
    # Items colors data structure
    hue = fctx.get_editor_value("Hue")
    color_variation = fctx.get_editor_value("Color Variation")
    hr, hg, hb, alpha = hue
    fctx.set_data_obj("hue_tuple", hue)
    color_array = list(hue)
    item_colors = []
    color_mult = 1.0 + float(color_variation) / 100.0
    opacity = float(fctx.get_editor_value("Opacity")) / 100.0
    colors = fctx.get_editor_value("Colors")
    # Draw bg
    if colors == 0:
        for i in range(0, NUMBER_OF_HUES):
            array = np.array(color_array) * color_mult
            r, g, b, a = array
            item_colors.append(cairo.SolidPattern(_clamp(r), _clamp(g), _clamp(b), opacity))
            color_array = array
    else:
        palette = COLORS_LIST[colors - 1]
        for i in range(0, len(palette)):
            palette_hue = palette[i]
            color_array = list(palette_hue)
            hue_colors = []
            for j in range(0, 10):
                array = np.array(color_array) * color_mult
                r, g, b = array
                hue_colors.append(cairo.SolidPattern(_clamp(r), _clamp(g), _clamp(b), opacity))
                color_array = array
            item_colors.append(hue_colors)
    fctx.set_data_obj("item_colors", item_colors)
    # Animations data structure
    item_data = []
    number_of_items = fctx.get_editor_value("Number of Items")
    speed = fctx.get_editor_value("Speed")
    size = fctx.get_editor_value("Size")
    size_var_size_precentage = fctx.get_editor_value("Size Variation %")
    size_var_max = size * (size_var_size_precentage / 100.0)
    size_max = size + size_var_max
    fctx.set_data_obj("size_max", size_max)
    for i in range(0, number_of_items):
        path_pos = random.uniform(0.0, 1.0)
        y = random.randint(-330, 1080 + 330)
        size_var = random.uniform(-1.0, 1.0)
        item_size = size + (size_var * size_var_max)
        color_index = random.randint(0, NUMBER_OF_HUES - 1)
        # For palette colors we think of all hues being in single list.
        if colors != 0:
            hue_index = random.randint(0, len(palette) - 1)
            color_index = hue_index * NUMBER_OF_HUES + color_index
        item_data.append((path_pos, y, speed, item_size, color_index))
    data_sorted = sorted(item_data, key=lambda item: item[3])
    fctx.set_data_obj("item_data", data_sorted)