in toolkit/jb/svg.js [385:405]
function switchBlend(blend, text) {
return function() {
if (lastSelected && (lastSelected.value !== blend.value) && lastSelectedText) {
switchStates[lastSelected.value] = false;
lastSelectedText.attr('fill', 'black');
}
if (!blend) return;
var selected = switchStates[blend.value] ? false : true;
switchStates[blend.value] = selected;
text.attr('fill', selected ? 'white' : 'black');
if (selected) {
lastSelected = blend;
lastSelectedText = text;
return blend.value;
} else {
lastSelected = null;
lastSelectedText = text;
return '';
}
};
}