blob: e22c435fb0a5a7b7095e9c3e1d208034079ada73 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- saved from url=(0014)about:internet --><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="../../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../../override.css" type="text/css"><meta name="keywords" content="HSBInterpolator,spark.effects.interpolation.HSBInterpolator,decrement,decrement,decrement,decrement,decrement,getInstance,getInstance,getInstance,increment,increment,increment,increment,increment,interpolate,interpolate,interpolate,interpolate,interpolate"><title>spark.effects.interpolation.HSBInterpolator</title></head><body><script language="javascript" type="text/javascript" src="../../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../../help.js"></script><script language="javascript" type="text/javascript" src="../../../cookies.js"></script><script language="javascript" type="text/javascript"><!--
asdocTitle = 'HSBInterpolator - ApacheFlex API Reference';
var baseRef = '../../../';
window.onload = configPage;
--></script>
<script type="text/javascript">
scrollToNameAnchor();
</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">Apache Flex 4.16.1 API Reference </td><td class="titleTableTopNav" align="right"><a href="../../../package-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="../../../class-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../../all-index-A.html" onclick="loadClassListFrame('../../../index-list.html')">Index</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../../index.html?spark/effects/interpolation/HSBInterpolator.html&amp;spark/effects/interpolation/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../../images/logo.jpg" class="logoImage" alt="AdobeLogo" title="AdobeLogo"></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">HSBInterpolator</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#methodSummary">Methods</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("HSBInterpolator"); titleBar_setSubNav(false,false,false,false,false,false,false,false,true,false,false ,false,false,false,false,false);}
-->
</script><div xmlns:fn="http://www.w3.org/2005/xpath-functions" class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">spark.effects.interpolation</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public class HSBInterpolator</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">HSBInterpolator <img src="../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> Object</td></tr><tr><td class="classHeaderTableLabel">Implements</td><td> <a href="../../../spark/effects/interpolation/IInterpolator.html">IInterpolator</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version :&nbsp;</b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p></p><p></p>
The HSBInterpolator class provides Hue, Saturation, and Brightness (HSB)
color interpolation between RGB <code>uint</code> start and end values.
Interpolation is done by treating
the start and end values as integers with RGB color channel information in
the least-significant 3 bytes, converting these to HSB values, and
interpolating linearly for each of the h (hue), s (saturation),
and b (brightness) parameters.
<p>Because this interpolator may perform more calculations than a
typical interpolator that is simply interpolating a given type,
specifically to convert the RGB start and end values, this
interpolator provides the option of supplying start and end values
to the constructor. If you specify the start and end RGB values, then
the conversions of these values is calculated once,
and does not need to be done at every future call to
the <code>interpolate()</code> method during the animation.</p>
<p></p><br/><hr></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#HSBInterpolator()" class="signatureLink">HSBInterpolator</a>(startRGB:uint, endRGB:uint)</div><div class="summaryTableDescription">
Constructor.</div></td><td class="summaryTableOwnerCol">HSBInterpolator</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#decrement()" class="signatureLink">decrement</a>(baseValue:Object, decrementValue:Object):Object</div><div class="summaryTableDescription">
Returns the result of the two RGB values added
together as HSB colors.</div></td><td class="summaryTableOwnerCol">HSBInterpolator</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getInstance()" class="signatureLink">getInstance</a>():<a href="../../../spark/effects/interpolation/HSBInterpolator.html">HSBInterpolator</a></div><div class="summaryTableDescription">[static]
Returns the singleton of this class.</div></td><td class="summaryTableOwnerCol">HSBInterpolator</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#increment()" class="signatureLink">increment</a>(baseValue:Object, incrementValue:Object):Object</div><div class="summaryTableDescription">
Returns the result of the two RGB values added
together as HSB colors.</div></td><td class="summaryTableOwnerCol">HSBInterpolator</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#interpolate()" class="signatureLink">interpolate</a>(fraction:Number, startValue:Object, endValue:Object):Object</div><div class="summaryTableDescription">
The interpolation for the HSBInterpolator class takes the form of parametric
calculations on each of the three values h (hue), s (saturation),
and b (brightness) of HSB colors derived from the start and end RGB colors.</div></td><td class="summaryTableOwnerCol">HSBInterpolator</td></tr></table></div><script language="javascript" type="text/javascript"><!--
showHideInherited();
--></script><div class="MainContent"><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="HSBInterpolator()"></a><a name="HSBInterpolator(uint,uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">HSBInterpolator</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function HSBInterpolator(startRGB:uint, endRGB:uint)</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version :&nbsp;</b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p>
Constructor.
The optional parameters for <code>startRGB</code> and
<code>endRGB</code> help to optimize runtime performance by
performing RGB to HSB conversions at construction time, instead of
dynamically with every call to the <code>interpolate()</code> method.
</p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">startRGB</span>:uint</code> (default = <code>NaN</code>)<code></code> &mdash; The starting color, as an unsigned integer RGB value.
</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">endRGB</span>:uint</code> (default = <code>NaN</code>)<code></code> &mdash; The ending color, as an unsigned integer RGB value.
</td></tr></table></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="decrement()"></a><a name="decrement(Object,Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">decrement</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function decrement(baseValue:Object, decrementValue:Object):Object</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version :&nbsp;</b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
Returns the result of the two RGB values added
together as HSB colors. Each value is converted to an HSB color
first, and then each component (hue, saturation, and brightness)
is treated individually.
The saturation and brightness
components are clamped to lie between 0 and 1, and the hue degrees
are modulated by 360 to lie between 0 and 360.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">baseValue</span>:Object</code> &mdash; The start value of the interpolation.
</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">decrementValue</span>:Object</code> &mdash; The change to apply to the <code>baseValue</code>.
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Object</code> &mdash; The interpolated value.
</td></tr></table></div><a name="getInstance()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getInstance</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public static function getInstance():<a href="../../../spark/effects/interpolation/HSBInterpolator.html">HSBInterpolator</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version :&nbsp;</b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
Returns the singleton of this class.
<p>Note that the singleton
of the HSBInterpolator class might be less useful than separate instances
of the class because separate instances can take advantage of
precalculating the RGB to HSB conversions for the start and end colors.</p>
</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../../spark/effects/interpolation/HSBInterpolator.html">HSBInterpolator</a></code> &mdash; The singleton of the HSBInterpolator class.
</td></tr></table></div><a name="increment()"></a><a name="increment(Object,Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">increment</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function increment(baseValue:Object, incrementValue:Object):Object</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version :&nbsp;</b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
Returns the result of the two RGB values added
together as HSB colors. Each value is converted to an HSB color
first, and then each component (hue, saturation, and brightness)
will be treated individually.
The saturation and brightness
components are clamped to lie between 0 and 1, and the hue degrees
are modulated by 360 to lie between 0 and 360.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">baseValue</span>:Object</code> &mdash; The start value of the interpolation.
</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">incrementValue</span>:Object</code> &mdash; The change to apply to the <code>baseValue</code>.
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Object</code> &mdash; The interpolated value.
</td></tr></table></div><a name="interpolate()"></a><a name="interpolate(Number,Object,Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">interpolate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function interpolate(fraction:Number, startValue:Object, endValue:Object):Object</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version :&nbsp;</b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
The interpolation for the HSBInterpolator class takes the form of parametric
calculations on each of the three values h (hue), s (saturation),
and b (brightness) of HSB colors derived from the start and end RGB colors.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">fraction</span>:Number</code> &mdash; The fraction elapsed of the
animation, between 0.0 and 1.0.
</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">startValue</span>:Object</code> &mdash; The start value of the interpolation.
</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">endValue</span>:Object</code> &mdash; The end value of the interpolation.
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Object</code> &mdash; The interpolated value.
</td></tr></table></div><br/><br/><hr><br/><p></p><center class="copyright"><footer>The Apache Software Foundation</footer><br/>Wed Nov 15 2017, 09:50 AM +01:00 </center></div></body></html><!--The Apache Software Foundation<br/>Wed Nov 15 2017, 09:50 AM +01:00 -->