com.esri.arcgis.display
Interface IAlgorithmicColorRamp

All Superinterfaces:
IColorRamp, Serializable
All Known Implementing Classes:
AlgorithmicColorRamp

public interface IAlgorithmicColorRamp
extends IColorRamp, Serializable

Provides access to members that control the AlgorithmicColorRamp. A color ramp defined by two colors and the algorithm used to traverse the intervening color space between them.

Description

The IAlgorithmicColorRamp interface allows you to specify how the series of colors is created using several properties.

You can use any objects that supports the IColor interface to set the FromColor or ToColor properties, although returning the FromColor or ToColor always gives an HSVColor object. Note that the FromColor and ToColor properties are set by value; therefore you cannot change the RGB values directly from the IColor interface returned by the IAlgorithmicColorRamp interface.

There are three algorithms that the IAlgorithmicColorRamp interface uses: esriCIELabAlgorithm, esriHSVAlgorithm, and esriLabLChAlgorithm. There is very little difference between these Algorithms when the FromColor and the ToColor are of the same or very similar hue (for the sake of simplicity we will base this discussion on the HSV color model). But when the hues for the FromColor and the ToColor are different (Hue is different by 40 or more on a 0-360 scale), the algorithms produce different results. The esriHSVAlgorithm traverses the hue difference in a purely linear fashion, resulting in a bright ramp where all intermediate colors are represented. For instance, a ramp from red to green would include orange, yellow, and yellow-green. The esriCIELabAlgorithm and esriLabLChAlgorithm produce a more blended result. Thus, a ramp from dark green to orange would not contain a bright yellow, but instead a more brown and green-gold or green-brown intermediate color. The advantage of the CIELAB algorithm is that the colors of the ramp are visually equidistant, which produces a better ramp.

When To Use

Use the IAlgorithmicColorRamp when representing data in a layer that is sequential (interval or ratio data). Or, use the IAlgorithmicColorRamp when creating an IGradientFill symbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
IPresetColorRamp, IMultiPartColorRamp, IAlgorithmicColorRamp, IColorRamp.getColor(int), IRandomColorRamp, IColorRamp.createRamp(boolean[]), IColorRamp

Method Summary
 int getAlgorithm()
          The algorithm used to ramp between the first and last colors.
 IColor getFromColor()
          The first color in the color ramp.
 IColor getToColor()
          The last color in the color ramp.
 void setAlgorithm(int algorithm)
          The algorithm used to ramp between the first and last colors.
 void setFromColor(IColor color)
          The first color in the color ramp.
 void setToColor(IColor color)
          The last color in the color ramp.
 
Methods inherited from interface com.esri.arcgis.display.IColorRamp
createRamp, getColor, getColors, getName, getSize, setName, setSize
 

Method Detail

getFromColor

IColor getFromColor()
                    throws IOException,
                           AutomationException
The first color in the color ramp.

Description

FromColor is the first color in a IAlgorithmicColorRamp.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.IColor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IHsvColor, IHlsColor

setFromColor

void setFromColor(IColor color)
                  throws IOException,
                         AutomationException
The first color in the color ramp.

Description

FromColor is the first color in a IAlgorithmicColorRamp.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IHsvColor, IHlsColor

getToColor

IColor getToColor()
                  throws IOException,
                         AutomationException
The last color in the color ramp.

Description

ToColor is the second color in a IAlgorithmicColorRamp.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.IColor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IHsvColor, IHlsColor

setToColor

void setToColor(IColor color)
                throws IOException,
                       AutomationException
The last color in the color ramp.

Description

ToColor is the second color in a IAlgorithmicColorRamp.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IHsvColor, IHlsColor

setAlgorithm

void setAlgorithm(int algorithm)
                  throws IOException,
                         AutomationException
The algorithm used to ramp between the first and last colors.

Description

Algorithm is the ramping algorithm used to create intermediate colors between the FromColor and the ToColor .

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
algorithm - A com.esri.arcgis.display.esriColorRampAlgorithm constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAlgorithm

int getAlgorithm()
                 throws IOException,
                        AutomationException
The algorithm used to ramp between the first and last colors.

Description

Algorithm is the ramping algorithm used to create intermediate colors between the FromColor and the ToColor .

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.display.esriColorRampAlgorithm constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.