pslib
Class PSColourRamp

java.lang.Object
  extended by pslib.PSColourRamp

public class PSColourRamp
extends java.lang.Object

PSColourRamp Class

The PSColourRamp object allows ramping between two colour values over a specified time period.

An initial colour value is set on creation. Calls to set() will set a target colour which will be iterated to over the specified time period. Calls to get() will update the object and return a reference to the current colour.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.

See Also:
PSColour

Constructor Summary
PSColourRamp(PSColour c)
          Create a new object instance with the specified colour
 
Method Summary
 PSColour get()
          Update and return a reference to the object colour
 void set(PSColour c)
          Set the object colour
 void set(PSColour c, int t)
          Set the target colour and transform duration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PSColourRamp

public PSColourRamp(PSColour c)
Create a new object instance with the specified colour

Parameters:
c - colour
Method Detail

set

public final void set(PSColour c)
Set the object colour

Parameters:
c - colour

set

public final void set(PSColour c,
                      int t)
Set the target colour and transform duration

Parameters:
c - target colour
t - duration (ms)

get

public final PSColour get()
Update and return a reference to the object colour

Returns:
a reference to the object colour