Is there a way to assign colors to color styles automatically for the document

I am migrating some sketch files which have color variables assigned to the layers in sketch. When imported to Figma all the variables are lost. Is there a way to assign them automatically.

Sketch provides a plugin which does this automatically for older files when variables were not available - “Color variables Migrator” Sketch — Color Variables Migrator

Looking for something similar for Figma.

There is this plugin, but it only works with local styles: Figma - Match fills to local styles | Converts every selected solid fill to a color in Local Color Styles, choosing the closest Local C... I guess you can then swap local to library styles using other plugins that allow you to switch themes.