Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Created October 13, 2020 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/6dadf39209079e588bcec71c9f41cb1d to your computer and use it in GitHub Desktop.
Save ljmotta/6dadf39209079e588bcec71c9f41cb1d to your computer and use it in GitHub Desktop.
Base64Png Editor Apply Tweak
useEffect(() => {
const ctx = canvasRef.current?.getContext("2d")!;
ctx.filter = `invert(${invert}%)`;
ctx.drawImage(imageRef.current!, 0, 0);
setEditorContent(canvasRef.current!.toDataURL().split(",")[1]);
}, [invert]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment