This document is archived and information here might be outdated.  Recommended version.


IAlgorithmicColorRamp Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Display > ESRI.ArcGIS.Display > Interfaces > IA > IAlgorithmicColorRamp Interface
ArcGIS Developer Help

IAlgorithmicColorRamp Interface

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.

Product Availability

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

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.

Members

Name Description
Read/write property Algorithm The algorithm used to ramp between the first and last colors.
Read-only property Color The color at the given index position. Call CreateRamp before calling this method.
Read-only property Colors The list of colors. Call CreateRamp before calling this method.
Method CreateRamp Generates a color ramp with length determined by Size value.
Read/write property FromColor The first color in the color ramp.
Read/write property Name The name of the color ramp.
Read/write property Size The number of colors that will be generated by the CreateRamp method.
Read/write property ToColor The last color in the color ramp.

Inherited Interfaces

Interfaces Description
IColorRamp Provides access to the methods and properties common to all color ramp objects.

Classes that implement IAlgorithmicColorRamp

Classes Description
AlgorithmicColorRamp Defines an algorithmic color ramp, where ramp is defined by two colors and the algorithm used to traverse the intervening color space between them.

See Also

AlgorithmicColorRampPropertyPage Class | IMultiPartColorRamp Interface | IColorRamp.Color Property | IColorRamp.CreateRamp Method | IRandomColorRamp Interface | IColorRamp Interface | IPresetColorRamp Interface | IAlgorithmicColorRamp Interface

.NET Samples

Use an AlgorithmicColorRamp to color a ClassBreaksRenderer Create a custom default raster catalog renderer Multivariate renderer