Great idea! I just pushed a new version with the option to include the current theme’s colors if it uses the editor-color-palette
support feature.
Could you return the full color information as defined in the color palette? So basically name, slug and value as an array maybe?
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_attr__( 'strong magenta', 'themeLangDomain' ),
'slug' => 'strong-magenta',
'color' => '#a156b4',
),
array(
'name' => esc_attr__( 'light grayish magenta', 'themeLangDomain' ),
'slug' => 'light-grayish-magenta',
'color' => '#d0a5db',
),
array(
'name' => esc_attr__( 'very light gray', 'themeLangDomain' ),
'slug' => 'very-light-gray',
'color' => '#eee',
),
array(
'name' => esc_attr__( 'very dark gray', 'themeLangDomain' ),
'slug' => 'very-dark-gray',
'color' => '#444',
),
) );
See: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#block-color-palettes
That would be great!
This isn’t related to the topic of this post, but I can say that would require rebuilding how this plugin’s custom colors are defined and stored. They are currently a simple comma-separated list of HEX values so there are no names or slugs. The theme palette colors are merely added to the HEX list.
If you want the full array of theme color data, I would just use WordPress’s native function for that for the time being.
get_theme_support('editor-color-palette');