Question

http://joeybabcock.me/tests/php/5.php Is my drawing application, The eraser tool is the last color, If you draw with one of the colors FIRST than you can erase it, but if you click on the eraser tool, it causes you to erase it again no matter what color you choose. I have tried to combat this by completely redoing the color palette with all the colors being changed to rgba with an opacity of one, however, java script doesn't seem to like this and changes them to rgb and ignores the 1. I thought this was just an issue with rgba so i tried hsla but same thing, it converts them to rgb. While this would make a useful color converter, thats not what i need. You may specifically want to look at the colors.js in the resources tab of inspect element or whatever you use. Here's a direct link, http://joeybabcock.me/js/colors.js

Was it helpful?

Solution

Your eraser changes the compositing to "destination-out".

When you're done with erasing you must change compositing back to its default: "source-over".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top