Chiselled from East Ayrshire’s rolling moors, coal kept the wheels of industry turning, bringing jobs and powering the manufacture of iron, bricks and railways.

But the sprawling open cast coalfields came at a huge environmental price: along with carbon emissions, coal mining left a dreary landscape which, even after millions of pounds of restoration work, still served as little more than stark reminders of jobs long gone.

With precious few flowers, trees or shrubs to attract birds, bees and bugs, former open cast mines sites such as Dunstonhill near Patna, were likened by some to a bleak lunar landscape.

Soon, however, the grim terrain around it and another former East Ayrshire open cast site will ignite in a blaze of colour, which it’s hoped will attract wildlife and eventually provide sanctuary to one of Scotland’s rare butterflies.

In recent weeks volunteers carrying bags of native Scottish wildflower seeds have covered an area roughly the size of 14 football pitches, laying down what will eventually become a carpet of colour.

If all goes to plan, where there was little apart from tufts of grass, stones and occasional weeds will become a dazzling sea of pinky-white yarrow, nodding heads of oxeye daisies, clusters of purple flowered selfheal and fronds of bright yellow lady’s bedstraw waving in the breeze.

The work at Dunstonhill is part of an East Ayrshire Coalfield Environment Initiative (CEI) project aimed at breathing fresh life and colour into the area’s former open cast minefields, luring back to the bare moors the pollinators and insects which once thrived amid its vast rural landscape.

At Piperhill, another open cast mine near Sinclairston, wildflower seeds were recently scattered across a three hectares area, while in October last year CEI’s Coalfields for Pollinators project sowed an entire wildflower meadow at Craigengillan Estate, on land previously given over to hay.

The meadow has now become home to scorpion flies, ringlet butterflies, chimney sweeper moths, golden ring and common blue dragonflies.

At Dunstonhill, where 90 jobs were lost when the Scottish Coal operated mine closed in 2013, it’s hoped the combination of wildflowers and the rocky slope of the hill can help revive the dwindling fortunes of a far less vibrant visitor.

Dingy skipper butterflies - small, greyish brown pollinators that can easily be mistaken for moths – have become increasingly rare in recent years, although a small colony is known to exist in nearby Auchinleck. The project is planting the butterflies’ favoured bright yellow bird’s-foot- trefoil in the hope of attracting a new Dunstonhill colony.

The pollinator project is also working with local schools, helping children understand the impact of the area’s industrial heritage and the flowers and wildlife on their doorstep.

Emily Hay, project officer for Coalfields for Pollinators, says the hope is to enhance existing wildflower habitats and create new ones across the East Ayrshire coalfield area which will encourage and boost pollinator numbers.

“We are starting with former open cast coal mine sites where land has been used, dug up and become environmentally and economically unviable: nothing can be built on it and you can’t grow crops on it,” she says.

“At Dunstonhill, there is a great, imposing area - almost like a lunar landscape - with a huge slope to where the mine used to be.

“There’s nothing of the mine left to see, and nothing much growing there. It’s very barren with a massive water filled void at the bottom.

“We have now sown nine hectares with Scottish native wildflower seeds and although we know we can’t just put down seeds and flowers will spring up, we hope that over the next ten years we can nurture these seeds until the whole area is covered in beautiful wildflowers that are native to Scotland.”

From the mid-1800s, East Ayrshire was the site of a booming open cast coal industry which helped to fuel the Industrial Revolution, powering iron and brickworks, textile mills and helping to build Kilmarnock’s international reputation as a powerhouse for railway rolling stock.

Miners’ rows were built for mineworkers and their families, with entire communities beholden to powerful bosses for their homes and provisions which had to be bought from company stores and with the constant threat of eviction.

The onset of the Trade Unions Act in the early 1870s inspired workers to fight for a better deal. Led by James Keir Hardie, Ayrshire’s miners mounted a 10- week strike which, although unsuccessful, sparked the beginning of a more powerful Scottish Miners Federation.

Efforts were made to introduce new industries down the years but coal remained the area’s dominant employer – resulting in major hardship for families as mines closed.

Millions of pounds have been spent restoring the landscape, including £3 million ploughed into Dunstonhill five years ago after it was left unrestored following the liquidation of owners, Scottish Coal.

The restoration work saw large quarry voids made safe, tree planting, paths and signposting, however the dearth of colour from flowers and small shrubs meant it still looked bare and lifeless.

Alongside the Coalfields for Pollinators project, CEI is also involved in peatland restoration work, which has seen more than 600 hectares of peat bog across old coalfields on hillsides above villages such as Auchinleck and Mauchline revitalised.

The work included 130 hectares of land within the Muirkirk Uplands Site of Special Scientific Interest and saw specialist peatland restoration contractors instal more than 4,000 dams and water-retaining bunds to re-wet the degraded peatland.

As a result, peat-forming Sphagnum mosses and bog plants can now grow in the blocked ditches, eventually sealing them with new peat which will help reduce greenhouse gas emissions, improve local water quality and protect habitat for rare species such as hen harriers, curlew and Large Heath butterflies.

The charity is also undertaking a healthy rivers project which will help East Ayrshire communities to conserve river environments by teaching a simple biological monitoring technique to detect variations in river water quality. The results can be shared with the Scottish Environment Protection Agency (SEPA).

The three projects are part of a wider Coalfield Communities Landscape Partnership which is overseeing a range of community-led projects over the Doon Valley, Cumnock and Lugar Valley spanning local industrial heritage, archaeology, landscape enhancement, art and biodiversity at former open cast sites.

Emily says a key element of the Coalfields for Pollinators project is to inspire young people to understand the impact mining had on the landscape.

“The coalfields area was once very built up and when the industry closed the mines it ripped the heart out of the area. It left high levels of poverty and not many opportunities.

“But the area is rich in natural heritage and landscape, and the people in East Ayrshire are passionate about the history of where they live,” she says.

“Schoolchildren are learning the landscape is a rich natural resource and something they have to depend on.

“They don’t have big offices and supermarkets to work in - those opportunities don’t exist in the area, and the opportunities they have are working on the land.

“We are teaching them how to respect it, and that by looking after the land, it will look after them.”