scenic
Class LinearColorFunction

java.lang.Object
  extended by scenic.LinearColorFunction
All Implemented Interfaces:
ColorFunction

public class LinearColorFunction
extends java.lang.Object
implements ColorFunction

This class is used for creating color slides in gradients. The gradient color is defined using two or more nodes. Each node has a position and a color. The colors between two consecutive nodes are linearely interpolated to produce a smooth color slide.


Constructor Summary
LinearColorFunction()
          Constructs a LinearColorFunction object.
 
Method Summary
 void addNode(double position, ScenicColor color)
          Adds a new node to this object.
 double max()
          Returns the maximum position of the function.
 double min()
          Returns the minimum position of the function.
 ScenicColor value(double x)
          Returns the color value at the given position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearColorFunction

public LinearColorFunction()
Constructs a LinearColorFunction object.

Method Detail

addNode

public void addNode(double position,
                    ScenicColor color)
Adds a new node to this object.

Parameters:
position - the position of the node.
color - the color of the node.

value

public ScenicColor value(double x)
Description copied from interface: ColorFunction
Returns the color value at the given position.

Specified by:
value in interface ColorFunction
Parameters:
x - the argument.
Returns:
the color.

min

public double min()
Description copied from interface: ColorFunction
Returns the minimum position of the function.

Specified by:
min in interface ColorFunction

max

public double max()
Description copied from interface: ColorFunction
Returns the maximum position of the function.

Specified by:
max in interface ColorFunction