If you are looking to change the theme of your SharePoint 2013 and SharePoint Online site you can do this through CSOM.
Having connected to your environment you can run the below script that will change the theme to the Colour Palette to you have create – see this blog post on creating colour palettes
$web.ApplyTheme( “/_catalogs/theme/15/NewColourPalette.spcolor”, “/_catalogs/theme/15/NewFont.spfont”, “/_catalogs/theme/theme/15/BackGroundImage.jpg” , $True)
$web.update()
$ctx.Load($web)
$ctx.ExecuteQuery()
To see how to connect to your environment so the following blog post – Connecting to SharePoint Online through CSOM and PowerShell