TatukGIS menu

Blogs

Refreshed Color Ramp Rendering

In May, TatukGIS released a significant redesign and enhancement of the color ramp rendering functionality in its GIS Developer Kernel, GIS Editor, and free GIS Viewer products. This update:

  • Improves the color ramp definitions and flexibility for greater possibilities, and
  • Opens the color ramp functionality to developers for easy customization using code.

Previously color ramps were available only within the Grid and Vector Wizards. Now DK developers can use this functionality more widely in their custom applications, such as to generate colormaps for Digital Elevation Models.

Accessing the color ramp functionality using code is simple:

  • get a specified color ramp by its name, using
    cr = TGIS_Utils.GisColorRampList.ByName(<color_ramp_name>);
  • then we can prepare a color map according to our needs, using
    cm = cr.RealizeMap(<mode>, <subclass>, <reverse>);

The improved functionality offers greater use flexibility, such as:

  • Color ramps can be prepared in continuous or discrete mode.
Continuous mode (default) Discrete mode
  • Besides the default ramp options, some ramps are prepared with variations reflecting a specific number of colors. Use the subclass parameter to request a color map with a defined number of colors, if such ramp exists.
Color ramp 3 colors
(subclass=3)
Default color definition
​(subclass=0)
Color ramp with 9 colors
​(subclass=9)
  • Colors in ramps can be reversed (inverted), by setting the reverse parameter to True.
Default color ramp definition (reverse=True) Reversed color ramp (reverse=True)
 

This update additionally refreshes the list of built-in color ramps with:

  • unified and clear naming, and
  • some interesting new, cool looking, ramps.

Perhaps most important, users now have the ability create their own color ramp definitions and save them to the global list of built-in ramps.

The full list of built-in color ramps is presented below. The ramps fall into 3 categories:

  1. Qualitative color schemes that use differences in hue to represent nominal differences, or differences in kind. The lightness of the hues used for qualitative categories should be similar, but not equal. Data about land use or land cover, for example, are well represented by a qualitative color scheme.
  2. Sequential color schemes order data from high to low, accenting the highest as a dark shade and the lowest as a light shade (or vice versa). Sequential schemes are best for mapping quantitative data.
  3. Diverging color schemes are best at highlighting a particular middle range of quantitative data. Pick two saturated contrasting colors for the extremes of the data, and the middle ranges blend into a lighter mix of the two extremes. This is particularly useful for accenting the mean of a dataset and exposing locations that significantly stand out from the mean.
  Color schemes  
Qualitative Sequential Diverging
Posted: July 03, 2020
Filed under: DK, EDT