The code looks correct for it all
if using the following though you should use the background color after the foreground color, otherwise these will make the background back to default (black normaly i guess). For example ^w&RHmm&D will display it correctly background and all, while to use &r you should do &r^wHmm&D instead to get it to display correctly.
Could be wrong, but im assuming its an ANSI standard deal or maybe it just depends on the client you use lol go fiqure. Maybe someone else can offer more info on this