decreased opacity for unfocussed nodes

i.e. all subgraphs not controllable by the selected actor become lighter
This commit is contained in:
David Mosbach 2023-05-23 15:47:09 +02:00
parent 82276d1a02
commit 48f7de6220

View File

@ -221,18 +221,20 @@ function removeState(state) {
* @returns The colour the given node should have.
*/
function getNodeColour(node) {
var standard = selectedActor.value === 'All Actors' || highlightedSources.includes(node.id) || highlightedTargets.includes(node.id)
var alpha = standard ? 'ff' : '55';
if (node.stateData && node.stateData.final !== 'False' && node.stateData.final !== '') {
if (node.stateData.final === 'True' || node.stateData.final === 'ok') {
return selection === node ? '#a4eb34' : '#7fad36';
return (selection === node ? '#a4eb34' : '#7fad36') + alpha;
} else if (node.stateData.final === 'not-ok') {
return selection === node ? '#f77474' : '#f25050';
return (selection === node ? '#f77474' : '#f25050') + alpha;
} else {
//console.log(node.stateData.final);
}
} else if (node.name === '@@INIT') {
return selection === node ? '#e8cd84' : '#d1ad4b';
return (selection === node ? '#e8cd84' : '#d1ad4b') + alpha;
} else {
return selection === node ? '#5fbad9' : '#4496b3';
return (selection === node ? '#5fbad9' : '#4496b3') + alpha;
}
}