Customise Palette in Gutenberg Blocks
The code below will customise the colour palettes within the Gutenberg Block Editor in WordPress. As far as I know there is no restriction on the number of colours that can be specified here.
add_action( 'after_setup_theme', function() {
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Black' ),
'slug' => 'Black',
'color' => '#000000',
),
array(
'name' => __( 'Charcoal' ),
'slug' => 'Charcoal',
'color' => '#264653',
),
array(
'name' => __( 'Persian Green' ),
'slug' => 'PersianGreen',
'color' => '#2A9D8F',
),
array(
'name' => __( 'Orange Yellow Crayola' ),
'slug' => 'OrangeYellowCrayola',
'color' => '#E9C46A',
),
array(
'name' => __( 'Sandy Brown' ),
'slug' => 'SandyBrown',
'color' => '#F4A261',
),
array(
'name' => __( 'Burnt Sienna' ),
'slug' => 'BurntSienna',
'color' => '#E76F51',
),
array(
'name' => __( 'White' ),
'slug' => 'White',
'color' => '#FFFFFF',
),
) );
} );