forked from: 虹色変化
//////////////////////////////////////////////////////////////////////////////
虹色変化
//////////////////////////////////////////////////////////////////////////////
/**
* Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/iaIZ
*/
// forked from ProjectNya's 虹色変化
////////////////////////////////////////////////////////////////////////////////
// 虹色変化
////////////////////////////////////////////////////////////////////////////////
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 static var max:uint = 10;
private var circles:Array = new Array();
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();
colorTrans = new ColorTransform();
color = new ColorHSV(0, 1, 1);
for (var n:uint = 0; n < max; n++) {
var circle:Shape = new Shape();
addChild(circle);
circle.x = 232;
circle.y = 232;
circle.graphics.beginFill(0x000000);
circle.graphics.drawCircle(0, 0, 100 - 10*n);
circle.graphics.endFill();
color.s = 0.28 + 0.08*n;
colorTrans.color = color.value;
circle.transform.colorTransform = colorTrans;
circles.push(circle);
}
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
private function update(evt:Event):void {
color.h ++;
for (var n:uint = 0; n < max; n++) {
var circle:Shape = circles[n];
color.s = 0.28 + 0.08*n;
colorTrans.color = color.value;
circle.transform.colorTransform = colorTrans;
}
}
}
}