Andy,
If I'm reading the source code correctly, and I probably am not, there are 5 length lines and they are based upon the following:
Length is based upon speed 0 to 500 knots
Short <100 knots
medium short 100 - 199
medium 200 - 299
medium long 300 - 399
long >400
Colors are:
green = well below you, not a threat
blue = well above you, not a threat
red = below you, close, potential threat
magenta = above you, close potential threat
Not quite sure on the logic used to determine the threat level, haven't gotten that far.
The numbers you are referring to is simply the GPS derived altitude relative to you (above or below you). If the altitude has the suffix of "PA" then the listed altitude is their relative altitude based upon pressure altitude. If you have a GPS in your ADS-B in unit and it is working you should not have "PA" displayed.
Hope that helps.
Jeff