Change YouTube Text Color

Change the text color of YouTube's website to a bright and vibrant color every second

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Change YouTube Text Color
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Change the text color of YouTube's website to a bright and vibrant color every second
// @author       You
// @match        https://www.youtube.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to generate a random bright and vibrant color in hexadecimal format
    function getRandomColor() {
        const brightness = 50; // Adjust brightness (0 to 100)
        const hue = Math.floor(Math.random() * 360); // Random hue (0 to 359)
        return `hsl(${hue}, 100%, ${brightness}%)`;
    }

    // Function to change the text color to a random bright and vibrant color
    function changeTextColor() {
        document.querySelectorAll('*').forEach(function(element) {
            element.style.color = getRandomColor();
        });
    }

    // Set interval to change the text color every second
    setInterval(changeTextColor, 1000);
})();