The clone armour colours are, so typically, not elaborated upon by Disney and we do not expect them to ever do so. So we will use the original, now Legends, companion resources to answer your questions.
Phase I clone armour is, following Kaminoan sense of aesthetics, pure white. The colour stripes you are asking about is used to indicate rank:
- Pure white: Your generic buckethead
- Olive green: Sergeant - Squad commander of 9
- Blue: Lieutenant - Platoon commander of 4 squads
- Red: Captain - Company commander of 4 platoons
- Yellow: Commander - Regiment commander of 4 battalions of 4 companies each
Phase II Clone armour, on the other hand, follows the Jedi Order's drive to promote identity and camaraderie. Various colours and designs are used as unique identifiers of unit and belonging.
Example 1: Clone Commander Cody would have worn yellow stripes in Phase I armour, but in Phase II armour the entire 212th Attack Battalion used yellow.
Example 2: Clone Captain Rex would have worn red stripes in Phase I armour, but in Phase II armour the entire 501st Legion used blue.
Note that this applies only to regular, otherwise-white clone armour. Specialised armour are not subject to such variations due mostly to tactical constraints such as camouflage.
Most clone officers are further encouraged to demonstrate individuality by means of offering them most of the same equipment options as ARC Troopers in customising their loadout.