<?php
$wp_customize->add_setting( 'custom_colors[colors]', array(
'type' => 'option',
'default' => array(),
'sanitize_callback' => function( $colors ) { /* ... */ return $colors; },
) );
add_action( 'customize_save_after', function ( $wp_customize ) {
$is_colors_changed = array_key_exists(
'custom_colors[colors]',
$wp_customize->unsanitized_post_values()
);
if ( $is_colors_changed ) {
// update the CSS used to output colors
$opts = get_option( 'custom_colors', array() );
$opts['css'] = wpcom_create_css_for_colors( $colors );
update_option( 'custom_colors', $opts );
}
} );