Grass is composed of eukaryotic plant cells. Plant cells contain several organelles that animal cells do not. One of these organelles is called the chloroplast. Within the chloroplasts there are stacks (granum) of disc-shaped thylakoids. Inside the chloroplasts is a green pigment called chlorophyll. It is the chlorophyll that captures the sunlight energy during photosynthesis. The sunlight energy is used during photosynthesis to convert carbon dioxide and water into oxygen gas and a sugar that is called glucose.
Some plants, or parts of plants (such as the petals), are colors other than green. This is due to the fact that they contain different plant pigments in their chloroplasts. For example, xanthophylls are yellow pigments (found in flowers such as lillies). Carotenoids are orange plant pigments (carrots have a lot of carotenoids).