Made this thing 3 weeks ago using custom JS on my glitchsoc-based Mastodon instance, I still want to tweak it, but I kinda wish Mastodon would support accent colors or something.
They removed the ability to colour roles a long while ago, but I added it back, and using custom CSS to target the roles, I can expose to the JS custom accent colors for those roles, which are then used as an accent color for the profile page and some elements like buttons.
If the role doesn't exist, then the color is extracted from the profile picture.
It's delayed due to me performing checks after the glitch ready function is called, plus checks and retries for the role, then for the picture.
I can only hope Mastodon or at least third-party web and mobile clients like Moshidon can support stuff like this again, would be nice to see.