Skip to content

Commit

Permalink
Fixed transparent diagonal bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vcamarzana committed Nov 28, 2024
1 parent 0183bd4 commit b9e1da8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ export const ColorPicker: React.FC<Props> = props => {
setHsva(hexToHsva(color));
};

const handleChange = (color: ColorProps) => {
setHsva(color.hsva);
onChange(color.hexa);
};

const handlePresetColors = (newColor: string) => {
const hsvaColor = hexToHsva(newColor);
setHsva(hsvaColor);
onChange(newColor);
};

const handleChange = (color: ColorProps) => {
setHsva(color.hsva);
onChange(color.hexa);
};

return (
<>
<div className={classes.container}>
<p>{label}</p>
<button
data-color={hsva.a === 0 ? 'noColor' : ''}
data-color={hexToHsva(color).a === 0 ? 'noColor' : ''}
className={classes.button}
style={{ backgroundColor: color }}
onClick={togglePicker}
Expand Down

0 comments on commit b9e1da8

Please sign in to comment.