$(document).ready(function(){
    var switchers = $('.colorSwitcher');
    $(switchers).each(function(){
        var input = $(this).find('input');
        var attr = $(input).attr('name');
        attr = attr + 'Picker';
        if($(input).prop('checked') == false)
        {
            $('input[name="'+attr+'"]').prop('disabled', true);
        }
    })
})

function disableColorPicker(e)
{
    let name = e.target.getAttribute('name');
    name = name+'Picker';
    let picker = document.querySelector('[name="'+name+'"]');
    if(e.target.checked){
        picker.disabled = false;
    } else {
        picker.disabled = true;
    }
}
