From an aftermarket head unit the color code will most often conform to the CEA standardized colors.
12V+ Constant - Yellow
12V+ Switched - Red
Ground - Black (sometimes with spade terminal)
Remote - Blue/White (sometimes with slide terminal)
Left Front Speaker Positive - White
Left Front Speaker Negative - White/Black
Right Front Speaker Positive - Gray
Right Front Speaker Negative - Gray/Black
Left Rear Speaker Positive - Green
Left Rear Speaker Negative - Green/Black
Right Rear Speaker Positive - Violet
Right Rear Speaker Negative - Violet/Black
If you are using a vehicle specific wiring harness, simply splice the head unit harness and vehicle specific harnesses together, color-for-color. If you are not using a vehicle specific harness, you need to identify the wire colors used by the vehicle manufacturer. There's many "databases" that have such information, including:
http://www.crutchfield.com
http://www.modifiedlife.com
http://www.the12volt.com