Pixie Plugins
Color to Transparent
A tool to turn all pixels that match the selected color transparent.
{
name: "Color to Transparent",
icon: "/images/icons/pill_go.png",
cursor: "url(/images/icons/pill_go.png) 15 12, default",
mousedown: function() {
var canvas = this.canvas;
var targetColor = this.color();
canvas.eachPixel(function(pixel) {
if(pixel.color() == targetColor) {
pixel.color("rgba(0,0,0,0)");
}
});
}
}
1st
{
name: "New Plugin",
icon: "/images/icons/wrench.png",
cursor: "url(/images/icons/wrench.png) 15 0, default",
mousedown: function() {
// TODO: Code your plugin here
// Example: reading the color of the clicked pixel
alert(this.color());
// Example: Pixel has referance to canvas
var canvas = this.canvas;
}
}
