What does limestone have in common with these?
Both of them are mainly made of the mineral calcium carbonate.
Limestone is formed most readily in warm shallow waters, which is the environment that shell-dwelling sea creatures love. When these animals die, their shells get tossed and broken by the water, and the bits pile up on the sea bed.
As the amount builds up, pressure compacts it, fluids are squeezed out and crystals reform until everything is cemented together, forming limestone.
So limestone is formed from sediment – calcium-rich sediment. This makes it a sedimentary rock.
Limestone is usually a greyish rock but the colour varies depending on what else is present when it is being formed. The sea environment will vary from place to place. There may be sand washing around or a river might flow out nearby and bring mud. Also changes in the environment cause different layers in the limestone.
So next time you are in a limestone area, see if you can see the layers. And also have a look for fossils. You can often spot bits of shell.