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?

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

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