Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (finalStates.indexOf(name) !== -1) {
type = 'FINAL_STATE';
fillColor = finalStateColor;
} else if (initialState === name) {
type = 'INITIAL_STATE';
fillColor = initialStateColor;
} else {
type = 'REGULAR_STATE';
fillColor = regularStateColor;
}
let isSelected = selectedStates.indexOf(name) !== -1;
// border color
let color = isSelected ? rgb2hex(Color(fillColor).darken(0.3).rgb().string()).hex : 'transparent';
// eslint-disable-next-line max-len
let nodeStr = `node [shape = record fillcolor="${fillColor}" margin="0.2,0.1" color="${color}" fontname="Helvetica" style="rounded,filled", penwidth=6];`;
return `${nodeStr} "${getStateLabel(state.name)}" [id="oc-fsm--graph__node----${encodeURIComponent(state.name)}"]`;
}).join(' ');
}
colors={[color0, color1].map((c) => rgb2hex(c).hex)}
start={gStart}