My guess is that they don't first randomly generate colours and then heroes from those categories, but that they directly generate the heroes, and just show you the colours. This way is simpler and the other way they couldn't really say you get a 3% chance for Focus heroes, since it's possible that you can't get them at all depending on the colours you get.
-------------------------------------------------------------------------------------------------------------------
Right, that's probably how they generate it, but that also means we can use some conditional probability to find the probability of a 5* when we know the color. When you initially roll, the game has a 6% chance of generating a 5* per roll, but since we find out what color a roll is before we pick it, we can find the probability of a 5* of that color relative to the rest of its color.
To make the following example easier to read:
# number of variable
c = color
f = focus
Chance of getting a 5* from c =(#cf5 / #f5 * .03 + #c5 / #5 * .03) / (#cf5 / #f5 * .03 + #c5 / #5 * .03 + #c4 / #4 * .36 + #c3 / #3 * .58)
It's hard to write, but the numerator is the sum of the probabilities of 5* heroes of that color, while the denominator is the sum of the probabilities of all the heroes of that color.
So, for example, if we're doing red on Legendary Heroes, there are 3 red Focus 5*s out of 4 total, 14 red 5*s out of 38 (they forgot Robin), 24 red 4*s out of 75 4*s, and 15 red 3*s out of 49 3*s.
If we plug that all in, we get:
(3/4 * .03 + 14/38 * .03) / (3/4 * .03 + 14/38 * .03 + 24/75 * .36 + 15/49 * .58) = .103
So if you pick a red pull, you have a 10.3% chance of it being a 5*, if I've got my numbers right.
So in total, the chance of drawing a 5* unit from a color x is (for Legendary Heroes):
10.3% for red
6.0% for blue
3.4% for green
2.3% for grey
Note that green and grey are close to the 3% probability for 5*s without rate-up, but they aren't exactly 3%, because there's variability in the number of 3/4/5*s for each color.