public class BoundsPaintScale extends Object implements ColorPaintScale, Serializable
 Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. 
 BSD-style license. See OpenTrafficSim License.
 
| Modifier and Type | Field and Description | 
|---|---|
| static Color[] | GREEN_RED3-color scale from green to red. | 
| static Color[] | GREEN_RED_DARK5-color scale from green to red with dark edges. | 
| Constructor and Description | 
|---|
| BoundsPaintScale(double[] bounds,
                Color[] boundColors)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| double | getLowerBound() | 
| Color | getPaint(double value) | 
| double | getUpperBound() | 
| static Color[] | hue(int n)Creates an array of  ncolors with varying hue. | 
| static Color[] | reverse(Color[] colors)Reverses the color array. | 
| String | toString() | 
public static final Color[] GREEN_RED
public static final Color[] GREEN_RED_DARK
public BoundsPaintScale(double[] bounds,
                        Color[] boundColors)
                 throws IllegalArgumentException
bounds - double[]; value boundsboundColors - Color[]; colors at boundsIllegalArgumentException - if less than 2 bounds, unequal number of bounds and colors, or duplicate boundspublic static Color[] reverse(Color[] colors)
colors - Color[]; array of colorspublic static Color[] hue(int n)
n colors with varying hue.n - int; number of colors.n colors with varying huepublic Color getPaint(double value)
getPaint in interface PaintScalegetPaint in interface ColorPaintScalepublic final double getLowerBound()
getLowerBound in interface PaintScalepublic final double getUpperBound()
getUpperBound in interface PaintScaleCopyright © 2014–2019 Delft University of Technology. All rights reserved.