Electrical wires have markings printed or stamped on the outside covering of the cable that tell what size and type of wire is it. However, looking deeper, the color of the wires inside of the casing, will tell what purpose does it serve. A licensed Redwood City electrician can be contacted if you are confused about the purpose of different color wires.
Red & Black Wires
Both are used for switch legs and hot wires. Black ones may feed an outlet or a switch. Red ones are the second hot wire in 220-volt installations. They are used to interconnect two hardwired smoke detectors. Never use black wire for a ground or a neutral connection.
Green & Bare Copper Wires
These are used for grounding only and ground the devices. They shall be bonded to appliance connections and junction boxes for safety.
Blue & Yellow Wires
These are also used as hot wires, but are often pulled in conduit. The blue ones are commonly used for travelers in 3-way and 4-way switch applications and are even used as switch legs to things like fans and lights. The yellow ones are often used for switch legs to control things like switched outlets, fans and lights.