About Synesthesia, skip if you already know, or don't care.
Synesthesia, for those that don't know, is a condition that causes a persons sensations to be crossed. People with this condition are called synesthetes, and tend to give particular items characteristics they may not actually have. One of the most common forms is grapheme-color where they feel like each letter and digit has an intrinsic color. The reason this is of interest is synesthetes can have much better memories because the characteristics they apply are easier for the brain to remember, i.e. remembering a sequence of numbers by their colors.
Reasons for trying to make this script.
One reason to get out of the way is I didn't know much about Javascript and wanted a project I could use to learn. The more interesting reason, though, is that some studies have tested if learning a grapheme-color relation can help someone develop an "pseudo-synesthesia" to possibly help with memory. The tests I saw first simply had participants read a book that had the text inside of it colored. If this script works on a great deal of text heavy sites, hopefully it'd give a similar result by simply changing text color of sites you're already looking at.
Here are two sites that explain better, hopefully:
http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0039799
https://www.newscientist.com/article/dn26578-people-taught-synaesthesia-learn-to-read-in-colour/
What it does.
The script recursively navigates DOM elements in order to find text and it changes each letter to a corresponding value. That's basically it...
Preemptive evasive maneuvers (Please at least read this part).
The colors used by default may not (read probably aren't) the best. I chose them from a list, trying to keep them different enough to be recognizable, and had a program shuffle them so I wouldn't have to choose where they go. The look up function is left at the top of the script so you can choose to map the colors however you please. Another note is that by default the 10 digits share the colors of the first 10 letters of the alphabet, again this was just so I wouldn't have to find 10 more colors. I also made the list of allowed HTML tags by looking up a list of them, some have been missed and others may not be necessary, I wasn't sure which HTML tags could contain text themselves or contain other elements that could, but wanted to prevent screwing with scripts and the like that could break if their content was changed. The whitelist of HTML tags is right below the color lookup table so anyone can add/remove tags if there are issues. There are some elements that can't be changed such as preformatted text, which would screw up formatting, and generated text such as google searches don't seem to color either, though maybe there's a solution for it. Lastly, there are 3 variables at the very top of the script that are meant to be changed if needed. One controls a delay added between recursive calls and can be changed or disabled, the delay is used because on text heavy sites the script can lock up your browser for a bit if it tries to run all at once. The other two are an option to enable a background coloring in case a website has a color that makes some characters hard to see in the color your set for them, and the other is the color of that background (default white).
Now that I've typed all that, I don't really think this will get much, if any, use but it's here so in case I lose it and it's public in case someone takes interest in it.