虹色変化
//////////////////////////////////////////////////////////////////////////////
虹色変化
//////////////////////////////////////////////////////////////////////////////
/**
* Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/6pL9
*/
////////////////////////////////////////////////////////////////////////////////
// 虹色変化
////////////////////////////////////////////////////////////////////////////////
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.events.Event;
import flash.geom.ColorTransform;
import frocessing.color.ColorHSV;
[SWF(backgroundColor="#000000", width="465", height="465", frameRate="30")]
public class Main extends Sprite {
private var circle:Shape;
private var colorTrans:ColorTransform;
private var color:ColorHSV;
public function Main() {
//Wonderfl.capture_delay(1);
init();
}
private function init():void {
graphics.beginFill(0x000000);
graphics.drawRect(0, 0, 465, 465);
graphics.endFill();
circle = new Shape();
addChild(circle);
circle.x = 232;
circle.y = 232;
circle.graphics.beginFill(0x000000);
circle.graphics.drawCircle(0, 0, 120);
circle.graphics.endFill();
color = new ColorHSV(0, 1);
colorTrans = new ColorTransform();
colorTrans.color = color.value;
circle.transform.colorTransform = colorTrans;
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
private function update(evt:Event):void {
color.h ++;
colorTrans.color = color.value;
circle.transform.colorTransform = colorTrans;
}
}
}