パッケージ | fl.motion |
クラス | public class Color |
継承 | Color ColorTransform Object |
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
関連する API エレメント
パブリックプロパティ
プロパティ | 定義元 | ||
---|---|---|---|
alphaMultiplier : Number
アルファ透明度チャンネル値に乗算する 10 進数値です。 | ColorTransform | ||
alphaOffset : Number
アルファ透明度チャンネル値に alphaMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。 | ColorTransform | ||
blueMultiplier : Number
青チャンネル値に乗算する 10 進数値です。 | ColorTransform | ||
blueOffset : Number
青チャンネル値に blueMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。 | ColorTransform | ||
brightness : Number
明るさのパーセンテージは、-1 ~ 1 の 10 進数値です。 | Color | ||
color : uint
ColorTransform オブジェクトの RGB カラー値です。 | ColorTransform | ||
constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。 | Object | ||
greenMultiplier : Number
緑チャンネル値に乗算する 10 進数値です。 | ColorTransform | ||
greenOffset : Number
緑チャンネル値に greenMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。 | ColorTransform | ||
redMultiplier : Number
赤チャンネル値に乗算する 10 進数値です。 | ColorTransform | ||
redOffset : Number
赤チャンネル値に redMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。 | ColorTransform | ||
tintColor : uint
0xRRGGBB 形式のティントカラー値。 | Color | ||
tintMultiplier : Number
ティントカラーを適用するパーセンテージは、0 ~ 1 の 10 進数値です。 | Color |
パブリックメソッド
メソッド | 定義元 | ||
---|---|---|---|
Color(redMultiplier:Number = 1.0, greenMultiplier:Number = 1.0, blueMultiplier:Number = 1.0, alphaMultiplier:Number = 1.0, redOffset:Number = 0, greenOffset:Number = 0, blueOffset:Number = 0, alphaOffset:Number = 0)
Color インスタンスのコンストラクター。 | Color | ||
2 番目のパラメーターで指定された ColorTranform オブジェクトと現在の ColorTransform オブジェクトを連結し、2 つのカラー変換を加算的に組み合わせた結果を現在のオブジェクトに設定します。 | ColorTransform | ||
[静的]
XML から Color インスタンスを作成します。 | Color | ||
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | ||
[静的]
あるカラー値から別のカラー値にスムーズにブレンドします。 | Color | ||
interpolateTransform(fromColor:flash.geom:ColorTransform, toColor:flash.geom:ColorTransform, progress:Number):flash.geom:ColorTransform [静的]
ColorTransform オブジェクトから別のオブジェクトにスムーズにブレンドします。 | Color | ||
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | ||
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | ||
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | ||
ティントカラーと量を同時に設定します。 | Color | ||
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。 | Object | ||
ColorTransform オブジェクトのすべてのプロパティが列挙されたストリングを書式設定して返します。 | ColorTransform | ||
指定されたオブジェクトのプリミティブな値を返します。 | Object |
プロパティの詳細
brightness | プロパティ |
brightness:Number
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
明度のパーセンテージ(-1
~ 1
の小数値)。正の値ではオブジェクトが明るくなり、1
の値でオブジェクトは完全に白になります。負の値ではオブジェクトが暗くなり、-1
の値でオブジェクトは完全に黒になります。
デフォルト値: 0。
実装
public function get brightness():Number
public function set brightness(value:Number):void
tintColor | プロパティ |
tintMultiplier | プロパティ |
tintMultiplier:Number
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
ティントカラーを適用するパーセンテージ(0
~ 1
の小数値)。tintMultiplier = 0
の場合、ティントカラーは不可視になり、ターゲットオブジェクトのカラーは変化しません。tintMultiplier = 1
の場合、ターゲットオブジェクトには 100% のティントが適用され、元のカラーはすべて不可視になります。
デフォルト値: 0。
実装
public function get tintMultiplier():Number
public function set tintMultiplier(value:Number):void
コンストラクターの詳細
Color | () | コンストラクター |
public function Color(redMultiplier:Number = 1.0, greenMultiplier:Number = 1.0, blueMultiplier:Number = 1.0, alphaMultiplier:Number = 1.0, redOffset:Number = 0, greenOffset:Number = 0, blueOffset:Number = 0, alphaOffset:Number = 0)
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
Color インスタンスのコンストラクター。
パラメーターredMultiplier:Number (default = 1.0 ) — このカラーを適用する比率値を 0 ~ 1 の間の進数値で示します。
| |
greenMultiplier:Number (default = 1.0 ) — このカラーを適用する比率値を 0 ~ 1 の間の進数値で示します。
| |
blueMultiplier:Number (default = 1.0 ) — このカラーを適用する比率値を 0 ~ 1 の間の進数値で示します。
| |
alphaMultiplier:Number (default = 1.0 ) — アルファ透明度チャンネル値に乗算される 0 ~ 1 の小数値。
| |
redOffset:Number (default = 0 ) — 赤チャンネル値に redMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。
| |
greenOffset:Number (default = 0 ) — 緑チャンネル値に greenMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。
| |
blueOffset:Number (default = 0 ) — 青チャンネル値に blueMultiplier 値を乗算した後に加算する数値です。数値の範囲は -255 ~ 255 です。
| |
alphaOffset:Number (default = 0 ) — アルファチャンネル値に alphaMultiplier 値を乗算した後に加算する数値。数値の範囲は -255 ~ 255 です。
|
メソッドの詳細
fromXML | () | メソッド |
interpolateColor | () | メソッド |
public static function interpolateColor(fromColor:uint, toColor:uint, progress:Number):uint
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
あるカラー値から別のカラー値にスムーズにブレンドします。
パラメーター
fromColor:uint — 0xRRGGBB 形式または 0xAARRGGBB 形式の開始時のカラー値。
| |
toColor:uint — 0xRRGGBB 形式または 0xAARRGGBB 形式の終了時のカラー値。
| |
progress:Number — トランジションのパーセンテージ(小数値)。0 は開始を、1 は終了を表します。
|
uint — 0xRRGGBB 形式または 0xAARRGGBB 形式の補間カラー値。
|
interpolateTransform | () | メソッド |
public static function interpolateTransform(fromColor:flash.geom:ColorTransform, toColor:flash.geom:ColorTransform, progress:Number):flash.geom:ColorTransform
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
ColorTransform オブジェクトから別のオブジェクトにスムーズにブレンドします。
パラメーター
fromColor:flash.geom:ColorTransform — 開始時の ColorTransform オブジェクト。
| |
toColor:flash.geom:ColorTransform — 終了時の ColorTransform オブジェクト。
| |
progress:Number — トランジションのパーセンテージ(小数値)。0 は開始を、1 は終了を表します。
|
flash.geom:ColorTransform — 補間された ColorTransform オブジェクトです。
|
setTint | () | メソッド |
public function setTint(tintColor:uint, tintMultiplier:Number):void
言語バージョン: | ActionScript 3.0 |
製品バージョン: | Flash CS3 |
ランタイムバージョン: | Flash Player 9.0.28.0, AIR 1.0 |
ティントカラーと量を同時に設定します。
パラメーター
tintColor:uint — 0xRRGGBB 形式のティントカラー値。
| |
tintMultiplier:Number — ティントカラーを適用するパーセンテージ(0 ~ 1 の小数値)。tintMultiplier = 0 の場合、ティントカラーは不可視になり、ターゲットオブジェクトのカラーは変化しません。tintMultiplier = 1 の場合、ターゲットオブジェクトには 100% のティントが適用され、元のカラーはすべて不可視になります。
|
例 この例の使用方法
ColorExample.as
この例では、静的メソッドの interpolateColor を使用して、MovieClip にカラートランジションを適用します。スプライトと同様に、簡単に使用できます。この例では、四角形の MovieClip を描画し、ステージ上をクリックして、MovieClip のカラートランジションを実行します。また、setTint メソッドの使用方法についても示します。ここでは、start_color にティントを設定します。
import fl.transitions.Tween; import fl.transitions.TweenEvent; import fl.transitions.easing.Strong; import fl.motion.Color; import flash.events.Event; import flash.geom.ColorTransform; var start_color:Color = new Color(); start_color.setTint(0xFF0000, 0.5); var final_color:uint=0x006699; var clip_mc:MovieClip=new MovieClip(); clip_mc.graphics.beginFill(start_color,1); clip_mc.graphics.drawRect(200,200,200,200); clip_mc.graphics.endFill(); addChild(clip_mc); var colorInfo:ColorTransform=clip_mc.transform.colorTransform; function initTween(event:MouseEvent):void { var my_tween:Tween=new Tween(clip_mc,'alpha',Strong.easeOut,0,1,1,true); my_tween.addEventListener(TweenEvent.MOTION_CHANGE,tweenToFinal); } function tweenToFinal(event:TweenEvent):void { colorInfo.color=Color.interpolateColor(start_color,final_color,event.position); clip_mc.transform.colorTransform=colorInfo; } stage.addEventListener(MouseEvent.CLICK,initTween);
Tue Jun 12 2018, 10:34 AM Z