_colorForCode: added switch statement over enum ColorMode
PTYTextView:colorFromRGB -> PTYTextView:colorFromRed
minor cleanup for style and safety