ColorBreak

Description

A ColorBreak element defines a range that indicates a cell having value in a range between two consecutive break values. It is rendered with the defined color of the cell.

Context

Table 1 lists the elements that can contain, or be contained by, a ColorBreak element.

Table 1. Context
Contained by Element Contains

ColorBreaksList

ColorBreak

(empty)

Attributes

Table 2 lists the attributes of a ColorBreak element.

Table 2. Attributes
Attribute Description

value

A Float value specifying the value of the color break.

Note: This attribute is required.

color

A String value specifying the color of the color break.

The value can be any valid CSS color. (See http://www.w3.org/TR/REC-CSS1#color-units.)

Note: This attribute is required.

Example

This example specifies a grid image style that contains a RenderStyle of type LUTColor, a Custom DataTransform having a collection of six color breaks, and a collection of three grid inflection points.

<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle xmlns="http://www.mapinfo.com/mxp" version="MXP_WorkSpace_1_5">
   <GridStyle id="migridstyle" name="migridstyle" contrast="0.5" brightness="0.5" opacity="1" grayscale="false" show-hillshade="false" null-color="black" null-transparent="true">
      <RenderStyle type="LUTColor" underviewInterpolation="None">
         <Component type="color" field="0" band="1" dataTransform="MapInfoDataTransform">
            <ColorTable>Pseudocolor.lut</ColorTable>
         </Component>
         <Hillshade>
            <SunShadow enable="True" />
            <Highlight enable="True" />
         </Hillshade>
      </RenderStyle>
      <DataTransformList>
         <DataTransform type="Custom" name="MapInfoDataTransform">
            <ColorBreaksList>
               <ColorBreak value="-182.586959838867" color="#0000ff" />
               <ColorBreak value="57420.302986145" color="#1919ff" />
               <ColorBreak value="115023.192932129" color="#5e5eff" />
               <ColorBreak value="172626.082878113" color="#eeeeff" />
               <ColorBreak value="230228.972824097" color="#7f7f7f" />
               <ColorBreak value="287831.862770081" color="#a5a5a5" />
            </ColorBreaksList>
         </DataTransform>
      </DataTransformList>
      <GridInflectionList>
         <GridInflection value="0.4" color="yellow" />
         <GridInflection value="0.5" color="green" />
         <GridInflection value="0.6" color="blue" />
      </GridInflectionList>
   </GridStyle>
</NamedStyle>  

Generating color breaks from Pro/GHX

In MapInfo Pro, if there are three breaks (i.e. 3 ranges and three colors) as following, then there will be 4 (N+1) breaks:
Range Color
(-412, 558.545429299221)

#FF00FEFE

(558.545429299221, 1529.09085859844) #FFFEFC00
(1529.09085859844, 8255) #FFFE0000
First break should have lower value of first range and color of first range: (value="-412" color="#FF00FEFE")
For generating subsequent breaks, take higher value of range and color (from range 1 to N)
(value="558.545429299221" color="#FF00FEFE") for 1st range
(value="1529.09085859844" color="#FFFEFC00") 2nd range
(value="8255" color="#FFFE0000") 3rd range
You can pass the colors in the following way:
  • name of color like green, red, and so on
  • three-digit representation #RGB in the range #000 to #FFF
  • six-digit representation #RRGGBB in the range #000000 to #FFFFFF
  • eight-digit representation #AARRGGBB in the range #00000000 to #FFFFFFFF
  • rgb(int, int, int) where "int" is any integer value and corresponds to the red, green, and blue color values respectively
  • rgb(float%, float%, float%) where "float" is any float value and corresponds to the percentage of red, green, and blue colors values respectively