Chart FX 7 for Java Server

com.softwarefx.chartfx.server
Class ColorBlender

java.lang.Object
  extended by com.softwarefx.chartfx.server.ColorBlender

public class ColorBlender
extends Object

Provides access to the ColorBlender object.

This Class allows you to easily obtain a gradient of colors between two selected color hues. By specifying a number of steps, developers may effortlessly create an even gradient of Color objects. Below is an example of how the ColorBlender object may be used to configure even gradient colors for series in a bar chart:

Sample Code:

ColorBlender cb = new ColorBlender(Color1,Color2,);
for (int i=0; i<NumberOfSeries; i++)
chart1.getSeries().get(i).setColor(cb.nextColor());


Constructor Summary
ColorBlender(Color fromColor, Color toColor, int steps)
           
 
Method Summary
 Color nextColor()
          Gets the next available gradient color from the blend.
 void startBlending()
          Resets the blender.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorBlender

public ColorBlender(Color fromColor,
                    Color toColor,
                    int steps)
Method Detail

nextColor

public Color nextColor()

Gets the next available gradient color from the blend.

Remarks:
  • NextColor is used to get the next available gradient color of the blender.

  • Below, the color of each series has been changed to different variations of blue using the property ColorBlender's NextColor property:

  • See Also:
    startBlending()

    startBlending

    public void startBlending()

    Resets the blender.

    Remarks:
  • StartBlending can be used to reset the blender. This is useful if you need a few gradient values and then need to return to the original color of the blender.

  • See Also:
    nextColor()

    http://www.softwarefx.com

    2008 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.