This might be what you are looking for
$args = array(
'default' => '#e9ecef',
'capability' => 'edit_theme_options',
);
if ( something() ) {
$args['output'] = array(
array(
'element' => 'body',
'property' => 'background-color',
),
);
}
$wp_customize->add_setting( 'modular_header_main_border_bottom_color', $args );
We are first creating an array for arguments. Later we are pushing a key value to that array with some conditions.