Bored ColorTransform

xiaoxiao2021-03-06  113

Class com.flashvan.drawing.colortransform

{

Private var_color: color;

Private var_target: movieclip;

Public Var RA, RB, GA, GB, BA, BB, AA, AB: Number;

Function ColorTransform (Transform: Array, Target: movieclip)

{

_target = target;

_COLOR = New color (_target);

Ra = transform [0];

RB = Transform [1];

Ga = Transform [2];

GB = Transform [3];

Ba = Transform [4];

BB = Transform [5];

AA = Transform [6];

ab = transform [7];

}

Public Function Run (): Void

{

IF (_target! = NULL)

_Color.SetTransform (this);

}

Public Function Reset (): Void

{

TRANSFORM = [100, 0, 100, 0, 100, 0, 100, 0];

_Color.SetTransform (this);

}

Public Function Get Target (): MovieClip

{

Return_target;

}

Public Function Set Target (Value: moviClip): Void

{

_target = value;

_COLOR = New color (_target);

}

Public Function Set Transform (Transform: array): Void

{

Ra = transform [0];

RB = Transform [1];

Ga = Transform [2];

GB = Transform [3];

Ba = Transform [4];

BB = Transform [5];

AA = Transform [6];

ab = transform [7];

}

Public function get transform (): array

{

Return [RA, RB, GA, GB, BA, BB, AA, AB];

}

}

To do the effect, pack it, save trouble: D. There is also a colorConverter. Mainly RGBTOHSB and HSBTORGB

usage:

Import com.flashvan.drawing.colortransform;

Var CT: ColorTransform = New ColorTransform ([100, 244, 100, 0, 100, 0, 100, 0], MC);

Ct.Run ();

Pre {Font-Family: "Courier New", Courier, Arial; font-size: 12px;}

. galan {color: # 000000;

. readyword {color: # 993300;

.IDENTIFIER {color: # 000087;

.properties {color: # 000087;

{Color: # 000087;

.linecomment, .bockcomment {color: # 808080;

. String {color: # 0000ff;}

转载请注明原文地址:https://www.9cbs.com/read-99624.html

New Post(0)