Don't get discouraged. If your food does not look like the picture in the cookbook, keep trying. After all, you're going to eat it no matter what it looks like.
Most of the recipes I try look nothing like the ones in the book. I expect that to happen. There is an extremely good chance that the food in the photographs are not actually edible. There is a whole industry devoted to producing a perfect picture of food. One picture will require a team of food stylists, lighting techs, one chef, photographers and specialty equipment, Sometimes the food is still raw, the color enhanced, something inedible sprayed on to make it look moist or other trade secret I am not aware of. All of this is needed because most food will not last under the photographic lighting long enough to take a good photograph. The picture included in the question is probably done that way, although there is no way to be sure. Fast food takes this to the extreme and raises some serious ethical concerns in my mind. For cookbooks, I would guess you are looking at the "ideal" as envisioned by the author of the book.
Even if the picture used is actually of the food, the ingredients you use will vary from the ones used in the book. Food is not a factory item. Color and texture will not be consistent even in the same batch of fruit, vegetables or meat. Those qualities even change over time as food ages. Following a recipe perfectly will not guarantee even results in the appearance, although taste seems to stay consistent. Even ovens will have differences in temperature depending on altitude, humidity, and environment.
In my opinion, and that is all is, people would be better off if they understood why certain steps are in a recipe. For example, Blanching vegetables, a few seconds in boiling water and then an ice bath, will help to preserve their color; but, even blanched vegetables will lose color if you cook them too long. The herb basil is added at the last few minutes to preserve flavor and color - certain herbs are more delicate than others..