Flower
write as3 code here..
/**
* Copyright onedayitwillmake ( http://wonderfl.net/user/onedayitwillmake )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/pxqL
*/
// forked from nutsu's f5 color test 1
// write as3 code here..
// write as3 code here..
package{
import flash.display.*;
import flash.events.*;
import frocessing.FC;
import frocessing.color.FColor;
import frocessing.core.F5Graphics2D;
[SWF(frameRate="60", width="465", height="465", backgroundColor="#000000")]
public class ColorWheel extends Sprite
{
private var numBlocks:int = 270;
private var startColor:int = 0;
public function ColorWheel()
{
stage.quality = 'low';
stage.scaleMode = 'noScale';
stage.align = "TL";
addEventListener(Event.ENTER_FRAME,draw);
}
private function draw(e:Event):void
{
startColor = (startColor + 1) % 360;
var n:int;
var c:FColor = new FColor();
c.hsv(startColor, 1, 1);
var fg:F5Graphics2D = new F5Graphics2D(graphics);
// trace(fg.gc);
fg.noStroke();
fg.rectMode(FC.CENTER);
fg.beginDraw();
fg.translate( stage.stageWidth * 0.5, stage.stageHeight * 0.5);
//fg.rotate( -FC.HALF_PI);
// if(numBlocks < stage.stageWidth * 0.5)
// numBlocks++;
n = numBlocks;
//var percentage =
for( var i:int=0; i< n; i++ )
{
for(var j:int = 0; j < 3; j++)
{
c.h -= 0.21
//c.h -= 0.1;
fg.fillColor = c.value;
fg.fillAlpha = 1
//Start locationX, startLocationY, howhigh, how wide
//fg.rect( (i+1) * 2, (i+1) * 2, 16 + (i*0.2), 16 + (i*0.2));
var grow:Number = 0.2;
var start:Number = (i < 100) ? 10.4 : 5;
//fg.circle(i,
fg.rect(i, i, start + (i * grow), start + (i * grow));
//fg.rotate(FC.PI * 56 / n - 0.08);
fg.rotate(0.2);
}
}
fg.endDraw();
}
}
}