Color wheel with no math
/**
* Copyright p4n7a ( http://wonderfl.net/user/p4n7a )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/yCSh
*/
package {
import flash.display.Sprite;
import flash.geom.Matrix;
import flash.display.BitmapData;
public class FlashTest extends Sprite {
public const w:uint=301, h:uint=309, R:uint=0xFF0000, G:uint=0x00ff00, B:uint=0x0000ff;
public function FlashTest() {
var m:Matrix=new Matrix();
m.createGradientBox(w,h);
graphics.beginGradientFill("linear", [R,R|G,G,G|B,B,B|R,R], [1,1,1,1,1,1,1], [0,42,85,128,170,213,255], m);
graphics.drawRect(0,0,w,h);
m.rotate(Math.PI/2);
graphics.beginGradientFill("linear", [0,0], [1,0], [0,255], m);
graphics.drawRect(0,0,w,h);
}
public function getBitmapData():BitmapData {
var bd:BitmapData=new BitmapData(w,h,false);
bd.draw(this);
return bd;
}
}
}