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,
borderColor: theme.palette.background.paper,
color: c,
transparency: props.lighting ? true : false,
layout: !props.lighting && [
{
component: iro.ui.Wheel,
options: {}
}
]
});
if (colorPicker)
colorPicker.on('input:end', (c: Color) => {
handleSetColor(