You spent time carefully matching one color to another only to find that when you got home the colors no longer match. You may be feeling frustrated and maybe even a little defeated. Don't be. You have just experienced something known as metamerism and I can tell you how to avoid this problem in the future.
Metamerism is an optical phenomenon that occurs when you see two color samples match under one light source yet do not match under another. Why does this happen? It comes down to the differences in how the two colors affect light, and thus how they appear to you when you look at them.
You see color because of light. When the different wavelengths of light shine on an object, some of the wavelengths are reflected and some absorbed. Simply put, an object that absorbs most of the blue, green, etc wavelengths and reflects back the red wavelengths will appear red to you.
For example, two materials you have chosen may each reflect the red wavelengths of light in approximately the same way, but one reflects the blue wavelengths of light while the other absorbs them. If you view both under most indoor lighting (tungsten) then they may appear to be very close to the same color. This is because very little blue light is falling on your samples and the difference between how they are reflecting the blue wavelengths of light is not picked up by your eye.
Now take your samples outside into the sunlight which contains more blue than your indoor lighting. With more blue wavelengths in this outdoor lighting source, the differences that were barely perceivable inside may now be glaringly apparent. What you thought were colors that match suddenly look quite different.
If you always viewed colors under the same light sources there would never be a problem. In the real world, however, there are many different types and colors of lighting so it is not surprising that you encountered this problem.
The easiest way to avoid having metamerism create a color mismatch is to always make your final color selection by looking at actual samples of the color where it will be used and under the same lighting conditions.
Finding samples that match in the showroom or store is not important. You want to get in the ballpark when shopping for color but then it is important to always bring samples back to your home to make the final selection.