Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
if (!pickerSetup) {
iro.use(iroTransparencyPlugin);
let colorPicker: {
on: (arg0: string, arg1: (c: Color) => void) => void;
} | null;
try {
let c = color
? color
: props.color
? props.color
: theme.palette.background.paper;
if (!c) c = 'rgba(255, 255, 255, 1)';
if (!validateColor(c)) c = 'rgba(255, 255, 255, 1)';
colorPicker = new iro.ColorPicker(pickerNode, {
width: 200,
padding: 0,
borderWidth: 1,