ColorAdjustment

Description

The ColorAdjustment element replaces color-1 with color-2 at the given opacity. If color-2 is absent, the only effect is to change the opacity of color-1. If opacity is absent, the effect is to change color-1 to color-2 and retain the opacity. If both color-2 and opacity are absent, this element has no effect.

Context

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

Table 1. Context
Contained by Element Contains

ColorAdjustmentSet

ColorAdjustment

(empty)

Attributes

Table 2 lists the attributes of a ColorAdjustment element.

Table 2. Attributes
Attribute Description

color-1

A string value specifying the color to be changed to the value of color-2, or whose opacity is to be changed to the value of opacity.

The value can be any valid CSS color. (See http://www.w3.org/TR/REC-CSS1#color-units.) Alternatively, the special value nonWhite can be used to specify every color except white (rgb(255,255,255)).

Note: This attribute is required.

color-2

A string value specifying the color to which color-1 is to be changed.

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

opacity

A floating-point value from 0 to 1 specifying opacity to which color-1 is to be changed.

Example

This example changes all colors that are not white to light green at full opacity.



<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle
    version="MXP_WorkSpace_1_5"
    xmlns="http://www.mapinfo.com/mxp">
    <Interior fill-opacity="1" fill="(#id7)">
        <Defs>
            <Pattern id="id7">
                <Bitmap uri="mapinfo:brush 2">
                    <ColorAdjustmentSet>
                        <ColorAdjustment
                            color-1="nonWhite"
                            color-2="rgb(224,255,176)"
                            opacity="1"/>
                    </ColorAdjustmentSet>
                </Bitmap>
            </Pattern>
        </Defs>
    </Interior>
</NamedStyle>