Applying landscape colour to grass?

Im currently trying to make my grass blend better with my landscape by getting the color information from it and applying it to the grass material. For instance I have light and dark patches on my landscape, and I want to have my grass match that colour, how might I do that?

http://i.imgur.com/k4LTRpr.png

I was able to figure it out with just changing around a few things I had before.

http://i.imgur.com/X4kZ7VE.jpg

Hey, this seems like a really cool feature. Do you mind sharing how you did it?

Thanks,