How is a movie made to show selective colors. For instance, in Pleasantville a sister and brother are transported to the universe of an old black and white TV show, and the movie switches to being B&W. Then, as the protagonists cause the inhabitants to have 'real' emotions, like fright, anger, or love, things (people, places, etc.) start having color. In the middle of the movie, many objects are still B&W, yet many more are now colorized.
Sin City also used this effect (the whole film was initially shot in full color, and was converted to black-and-white. Colorization is used on certain subjects in a scene), for example.
How is this effect achieved? Is it post-production editing? What techniques might a director employ to do this?