Just as the grains add sugars to the wort they also each contribute color. Grains which have been roasted longer during the malting process provide darker color as well as additional roasted flavor. You can see this amount in the grains/sugars listing under min/max color. This calculation sums the color added by each of the grains which depends on the weight of the grain addition and estimates the color based on the final batch amount. Other additions such as fruits may impact the color as well but are not accounted for in this calculation.
Beer Color Calculator
The grains, extracts and fermentable sugars you use contribute color to your beer. You can use this calculator to estimate the color of finished beer from a set of fermentables.