I have a usecase where we need to update the Gutenberg global color palette after the page has loaded using javascript. I am aware of the add_theme_support('editor-color-palette', ...)
PHP option but that will not work in this case.
It seems like it should be possible to dispatch an action using the following:
wp.data.dispatch( 'core/editor' ).updateEditorSettings( {colors: [{name: 'test', slug: 'test', color: '#00FF00'}]} );
This works to update the editor settings, which can be confirmed using:
wp.data.select( "core/editor" ).getEditorSettings()
However the UI does not re-render to show the updated color palette options.
Is there a way to trigger the blocks to re-render using the updating editor settings?