Improving this link color picker code

Create customizer.js file and put the following script in the customizer.js file

(function( $ ) {
    "use strict";   
    wp.customize( 'tcx_link_color', function( value ) {
        value.bind( function( to ) {
            $( 'a' ).css( 'color', to );
        } );
    }); 
})( jQuery );

And enqueue your customizer.js file by using wp_enqueue_script in your customizer.php file like this

function tcx_customizer_script() {
    wp_enqueue_script(
        'tcx-customizer',
        get_template_directory_uri() . '/js/customizer.js',
        array( 'jquery', 'customize-preview' ),
        '0.3.0',
        true
    );
}
add_action( 'customize_preview_init', 'tcx_customizer_script' );

Then it work fine