notice: Flash editor updated! Join the development! Thanks to MiniBuilder


forked from : checkmate's Saqoosha challenge for amateurs [diff(4)]

embed

FAVORITE BY
:
colorbeautiful
:
色きれいです。
:
checkmateこちらでテクスチャとして使用させていただきました。http://wonderfl.net/code/f332bc38c66c554e6abf7501b070b2e803ccba4e
:
FORKED
  1. // forked from Saqoosha's forked from: Saqoosha challenge for amateurs
  2. // forked from checkmate's Saqoosha challenge for amateurs
  3. package {
  4.     
  5.     import flash.display.Sprite;
  6.     import org.libspark.betweenas3.easing.Circ;
  7.     
  8.     [SWF(width=465, height=465, backgroundColor=0xffffff, frameRate=120)]
  9.     public class GradationTest1 extends Sprite {
  10.         
  11.         public function GradationTest1() {
  12.             // Gradationクラスを作る。任意の数のカラー値を渡すことができる。
  13.             var grad:Gradation = new Gradation(0xFFFFFF, 0xFFF200, 0xFF34D7, 0x9524CC, 0x1178D9);
  14.             grad.setEasing(Circ.easeInOut);
  15.             for (var y:int = 0; y < 465; y++) {
  16.                 // getColorでグラデーションを構成する中間色を取り出す。渡す値は0〜1。滑らかにこの値を変化させることでグラデーションを作り出す。
  17.                 graphics.beginFill(grad.getColor(y / 464));
  18.                 graphics.drawRect(0, y, 4651);
  19.                 graphics.endFill();
  20.             }
  21.         }
  22.     }
  23. }
  24. import frocessing.color.ColorLerp;
  25. import org.libspark.betweenas3.core.easing.IEasing;
  26. import org.libspark.betweenas3.easing.Linear;
  27. class Gradation {
  28.     
  29.     private var _colors:Array;
  30.     private var _easing:IEasing;
  31.     
  32.     public function Gradation(...args) {
  33.         _colors = args.concat();
  34.         _easing = Linear.linear;
  35.     }
  36.     
  37.     public function setEasing(easing:IEasing):void {
  38.         _easing = easing;
  39.     }
  40.     
  41.     public function getColor(position:Number):uint {
  42.         position = (position < 0 ? 0 : position > 1 ? 1 : position) * (_colors.length - 1);
  43.         var idx:int = position;
  44.         var alpha:Number = _easing.calculate(position - idx, 011);
  45.         if (alpha == 0) {
  46.             return _colors[idx];
  47.         } else {
  48.             return ColorLerp.lerp(_colors[idx], _colors[idx + 1], alpha);
  49.         }
  50.     }
  51. }
noswf
  1. // forked from Saqoosha's forked from: Saqoosha challenge for amateurs
  2. // forked from checkmate's Saqoosha challenge for amateurs
  3. package {
  4.     
  5.     import flash.display.Sprite;
  6.     import org.libspark.betweenas3.easing.Circ;
  7.     
  8.     [SWF(width=465, height=465, backgroundColor=0xffffff, frameRate=120)]
  9.     public class GradationTest1 extends Sprite {
  10.         
  11.         public function GradationTest1() {
  12.             // Gradationクラスを作る。任意の数のカラー値を渡すことができる。
  13.             var grad:Gradation = new Gradation(0xFFFFFF, 0xFFF200, 0xFF34D7, 0x9524CC, 0x1178D9);
  14.             grad.setEasing(Circ.easeInOut);
  15.             for (var y:int = 0; y < 1 y++) {
  16.                 // getColorでグラデーションを構成する中間色を取り出す。渡す値は0〜1。滑らかにこの値を変化させることでグラデーションを作り出す。
  17.                 graphics.beginFill(grad.getColor(y / 464));
  18.                 graphics.drawRect(0, y, 4651);
  19.                 graphics.endFill();
  20.             }
  21.         }
  22.     }
  23. }
  24. import frocessing.color.ColorLerp;
  25. import org.libspark.betweenas3.core.easing.IEasing;
  26. import org.libspark.betweenas3.easing.Linear;
  27. class Gradation {
  28.     
  29.     private var _colors:Array;
  30.     private var _easing:IEasing;
  31.     
  32.     public function Gradation(...args) {
  33.         _colors = args.concat();
  34.         _easing = Linear.linear;
  35.     }
  36.     
  37.     public function setEasing(easing:IEasing):void {
  38.         _easing = easing;
  39.     }
  40.     
  41.     public function getColor(position:Number):uint {
  42.         position = (position < 0 ? 0 : position > 1 ? 1 : position) * (_colors.length - 1);
  43.         var idx:int = position;
  44.         var alpha:Number = _easing.calculate(position - idx, 011);
  45.         if (alpha == 0) {
  46.             return _colors[idx];
  47.         } else {
  48.             return ColorLerp.lerp(_colors[idx], _colors[idx + 1], alpha);
  49.         }
  50.     }
  51. }
noswf
  1. // forked from Saqoosha's forked from: Saqoosha challenge for amateurs
  2. // forked from checkmate's Saqoosha challenge for amateurs
  3. package {
  4.     
  5.     import flash.display.Sprite;
  6.     import org.libspark.betweenas3.easing.Circ;
  7.     
  8.     [SWF(width=465, height=465, backgroundColor=0xffffff, frameRate=120)]
  9.     public class GradationTest1 extends Sprite {
  10.         
  11.         public function GradationTest1() {
  12.             // Gradationクラスを作る。任意の数のカラー値を渡すことができる。
  13.             var grad:Gradation = new Gradation(0xFFFFFF, 0xFFF200, 0xFF34D7, 0x9524CC, 0x1178D9);
  14.             grad.setEasing(Circ.easeInOut);
  15.             for (var y:int = 0; y < 465; y++) {
  16.                 // getColorでグラデーションを構成する中間色を取り出す。渡す値は0〜1。滑らかにこの値を変化させることでグラデーションを作り出す。
  17.                 graphics.beginFill(grad.getColor(y / 464));
  18.                 graphics.drawRect(0, y, 4651);
  19.                 graphics.endFill();
  20.             }
  21.         }
  22.     }
  23. }
  24. import frocessing.color.ColorLerp;
  25. import org.libspark.betweenas3.core.easing.IEasing;
  26. import org.libspark.betweenas3.easing.Linear;
  27. class Gradation {
  28.     
  29.     private var _colors:Array;
  30.     private var _easing:IEasing;
  31.     
  32.     public function Gradation(...args) {
  33.         _colors = args.concat();
  34.         _easing = Linear.linear;
  35.     }
  36.     
  37.     public function setEasing(easing:IEasing):void {
  38.         _easing = easing;
  39.     }
  40.     
  41.     public function getColor(position:Number):uint {
  42.         position = (position < 0 ? 0 : position > 1 ? 1 : position) * (_colors.length - 1);
  43.         var idx:int = position;
  44.         var alpha:Number = _easing.calculate(position - idx, 011);
  45.         if (alpha == 0) {
  46.             return _colors[idx];
  47.         } else {
  48.             return ColorLerp.lerp(_colors[idx], _colors[idx + 1], alpha);
  49.         }
  50.     }
  51. }
noswf
Get Adobe Flash Player