Those are group/bone colors. Blender use to highlight the entire row and sometimes it made it hard to read. So they opted to do the square instead. This is mainly to make it quicker for animators to identify.
As for the red and green you’ve already figured that out. Under the motion path panel there are display options and you can change the colors or even turn them off.