Actionscript:
-
var canvas:BitmapData = new BitmapData(500, 500, true, 0xFFFFFFFF);
-
var color:BitmapData= new BitmapData(500, 500, true, 0x81666666);
-
var over:BitmapData = new BitmapData(500, 500, true, 0xFF000000);
-
addChild(new Bitmap(canvas, "auto", true));
-
var circle:Shape = new Shape();
-
circle.graphics.beginFill(0xFFFFFF,1);
-
circle.graphics.drawCircle(0,0,50);
-
var m:Matrix = new Matrix();
-
m.tx = 0;
-
m.ty = 1;
-
addEventListener(Event.ENTER_FRAME, onLoop);
-
function onLoop(evt:Event):void {
-
circle.x = mouseX;
-
circle.y = mouseY;
-
canvas.draw(circle, circle.transform.matrix);
-
canvas.copyPixels(color, color.rect, new Point(0,0), null, null, true);
-
over.copyPixels(canvas, canvas.rect, new Point(0,0), null, null, true);
-
canvas.draw(over, m, null, BlendMode.SCREEN);
-
over.applyFilter(over, over.rect, new Point(-2,-2), new BlurFilter(10,10,1));
-
canvas.draw(over, m, null, BlendMode.SUBTRACT);
-
}
Grayscale emboss technique. More info here.