API Docs for: 最后更新日期:2014年8月25日
Google搜索   
Show:

LColorTransform Class

Extends LObject

Available since 1.9.4

Creates a LColorTransform object for a display object with the specified color channel values and alpha values. The ColorTransform class lets you adjust the color values in a display object. The color adjustment or color transformation can be applied to all four channels: red, green, blue, and alpha transparency. When a ColorTransform object is applied to a display object, a new value for each color channel is calculated like this: ・New red value = (old red value redMultiplier) + redOffset ・New green value = (old green value greenMultiplier) + greenOffset ・New blue value = (old blue value blueMultiplier) + blueOffset ・New alpha value = (old alpha value alphaMultiplier) + alphaOffset If any of the color channel values is greater than 255 after the calculation, it is set to 255. If it is less than 0, it is set to 0. You can use ColorTransform objects in the following ways: ・In the colorTransform parameter of the colorTransform() method of the LBitmapData class

Constructor

LColorTransform

(
  • redMultiplier
  • greenMultiplier
  • blueMultiplier
  • alphaMultiplier
  • redOffset
  • greenOffset
  • blueOffset
  • alphaOffset
)
public

Defined in geom/LColorTransform.js:1

Available since 1.9.4

Parameters:

  • redMultiplier Float

    The value for the red multiplier, in the range from 0 to 1.

  • greenMultiplier Float

    The value for the green multiplier, in the range from 0 to 1.

  • blueMultiplier Float

    The value for the blue multiplier, in the range from 0 to 1.

  • alphaMultiplier Float

    The value for the alpha transparency multiplier, in the range from 0 to 1.

  • redOffset Float

    The offset value for the red color channel, in the range from -255 to 255.

  • greenOffset Float

    The offset value for the green color channel, in the range from -255 to 255.

  • blueOffset Float

    The offset for the blue color channel value, in the range from -255 to 255.

  • alphaOffset Float

    The offset for alpha transparency channel value, in the range from -255 to 255.

Item Index

Methods

Properties

Methods

callParent

(
  • functionName
  • arguments
)
public

Inherited from LObject: main/LObject.js:22

Available since 1.6.0

call the method of parent。

Parameters:

  • functionName String

    function's name

  • arguments Array

    Fixed value : arguments

Example:

function funA(){
    LExtends(this,LObject,[]);
}
funA.prototype.myName = function(){
    return "AAA";
}
function funB(){
    LExtends(this,funA,[]);
}
funB.prototype.myName = function(){
    return "BBB";
}
function funC(){
    LExtends(this,funA,[]);
}
funC.prototype.myName = function(){
    return this.callParent("myName",arguments);
}
LInit(1000/50,"legend",800,150,main);
function main(){
    LGlobal.setDebug(true);
    var objB = new funB();
    trace(objB.myName());//BBB
    var objC = new funC();
    trace(objC.myName());//AAA
}

Properties

objectIndex

Int public

Inherited from LObject: main/LObject.js:11

Available since 1.6.0

ID of the object