Skip to content

Instantly share code, notes, and snippets.

@RazerMoon
Created April 18, 2020 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RazerMoon/c8a653e178a711ec8407e6affe0194c6 to your computer and use it in GitHub Desktop.
Save RazerMoon/c8a653e178a711ec8407e6affe0194c6 to your computer and use it in GitHub Desktop.
Change RGB values of username text
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