Created
April 18, 2020 03:54
-
-
Save RazerMoon/c8a653e178a711ec8407e6affe0194c6 to your computer and use it in GitHub Desktop.
Change RGB values of username text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let usernames = document.querySelectorAll(".username-1A8OIy") | |
for (let i = 0; i < usernames.length; i++) { | |
let rgb = usernames[i].style.color | |
if (rgb == 0) continue; | |
rgb = rgb.replace(/[^\d,]/g, '').split(',').map(Number); | |
let maxValue = Math.max(rgb[0], rgb[1], rgb[2]) | |
for (let e = 0; e < rgb.length; e++) { | |
if (rgb[e] < 70) rgb[e] = rgb[e] + 150; | |
} | |
usernames[i].style.color = `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment