?? palette.as
字號:
package flare.util.palette
{
import mx.core.IMXMLObject;
/**
* Base class for palettes, such as color and size palettes, that map from
* interpolated scale values into visual properties
*/
public class Palette implements IMXMLObject
{
/** Array of palette values. */
protected var _values:Array;
/** The number of values in the palette. */
public function get size():int { return _values==null ? 0 : _values.length; }
/** Array of palette values. */
public function get values():Array { return _values; }
public function set values(a:Array):void { _values = a; }
/**
* Retrieves the palette value corresponding to the input interpolation
* fraction.
* @param f an interpolation fraction
* @return the palette value corresponding to the input fraction
*/
public function getValue(f:Number):Object
{
if (_values==null || _values.length==0)
return 0;
return _values[uint(Math.round(f*(_values.length-1)))];
}
// -- MXML ------------------------------------------------------------
/** @private */
public function initialized(document:Object, id:String):void
{
// do nothing
}
} // end of class Palette
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -