Rainbow Fade Modified

join my discord server for updates and more: https://discord.gg/862cXbhXmh

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Rainbow Fade Modified
// @version      1.0
// @author       haykam821 (editd by Snowfall [_snowyfall_ on discord])
// @description  join my discord server for updates and more: https://discord.gg/862cXbhXmh
// @match        https://*diep.io/*
// @grant        none
// @namespace https://greasyfork.org/users/1329509
// ==/UserScript==

'use strict';

(() => {
    const script = document.createElement("script");
    script.src = "https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.3.7/chroma.min.js";
    document.head.append(script);

    const options = {
        speed: 0.25,
        pattern: ['#ba52ae', '#7a549c', '#5b599c', '#ba52ae'], // change the colors you want here they need to be in hex format, and the first color needs to be the same as the last!
    }

    const active = true

    script.addEventListener("load", () => {
        const pattern = chroma.scale(options.pattern).colors(1000);
        let index = 0;

        const change = () => {
            index += options.speed
            if (index >= pattern.length) index = 0;
            const scale = "0x" + pattern[index].substr(1);

            const nonIds = ['ren_score_bar_fill_color', 'ren_xp_bar_fill_color', 'ren_health_fill_color', 'ren_minimap_border_color', 'ren_stroke_solid_color'];
            const ids = [2, 13] // ur ffa and lb

            // 0 = smasher
            // 1 = cannons
            // 2 = you ffa
            // 3 = blue team
            // 4 = red team
            // 5 = purple team
            // 6 = green team
            // 8 = square
            // 9 = triangle
            // 10 = pentagon
            // 11 = crasher
            // 14 = maze wall
            // 13 = leaderboard
            // 14 = maze wall
            // 15 = opponent ffa
            // 16 = necro square
            // 17 = fallen team


            // ren_xp_bar_fill_color
            // ren_score_bar_fill_color = scoer bar
            // ren_health_background_color = health background color
            // ren_grid_color = grid color
            // ren_background_color = background
            // ren_minimap_arrow_color = minimap arrow color
            // ren_minimap_background_color = fill color of minimap
            // ren_minimap_border_color = border of minimap

            // ren_stroke_solid_color
            // ren_bar_background_color = bg of all bars like score, lb, xp, etc.

            if (active) {
                input.execute(`ui_replace_colors ${scale}`.repeat(100));

                nonIds.forEach(element => {
                    input.execute(`${element} ${scale}`);
                });

                ids.forEach(element => {
                    input.execute(`net_replace_color ${element} ${scale}`);
                });
            }
        }

        setInterval(change, 1)
    });
})();