Notes that are foreign to a piece's key are called "chromatic" pitches (from the greek, chroma, or "color.") They do indeed add "color," to a melodic line. Harmonically, do so as well by suggesting or implying other key areas (known as a temporary tonicization) or even modulate (meaning, we've changed keys entirely for a while).
Today we'll talk about a different technique, known as "enharmonic reinterpration." Any pitch may be spelled different ways. If I ask you to play a middle-C on the piano, and then I ask you to play a b-sharp (B#), you'll be pressing the same key twice. Depending on its context in a given triad (and within a given key) a pitch may be respelled in a score to show its function, but the listener may not be immediately aware of the respelling.
Consider the example below, which illustrates how enharmonic reinterpration works. If you're near a piano, please play along!
In the first measure, watch and hear the resolution of the interval of an augmented sixth (Ab in the bass against F# in alto). The interval is a dissonant and unstable one, and the resolution is achieved in the following chord where each voice moves apart by half-steps, to the octave. This type of "augmented sixth," voice-leading is heard in three common variants (often taught as "italian sixth," "german sixth," and "french sixth.")
Now compare that vertical sonority with the chord that spelled in the third measure. The blue box identified the enharmonic respelling--the tone "F#" is now spelled as a "Gb," while the other notes in that chord are all identical. Played on a piano, they will sound exactly the same.
The surprise of course, is that instead of our expected "augmented sixth pushing out to the octave," the dissonant interval--which is now spelled as a minor seventh--resolves by hearing the alto descend a half-step, while the bass voice drops a fifth. This sounds exactly like a dominant seventh chord resolution, and in this case, I've notated it as such by the symbols Ab7 - Db. We've effectively reinterpreted the chord both aurally and on paper, hearing it as a strong motion to the distant key of Db major!
Since the voice-leading is very smooth in both examples, the difficult gesture is accomplished fairly seamlessly. The underlying structure of the harmonic shift is accomplished through counterpoint.
Reinterpration creates an ambiguity (Ambiguitaet) around harmonic purpose of chromatic elements, an ambiguity that may be introduced sparingly (as in Beethoven) or extensively (Wagner).