Color palettes

Categorical

The default 9-color palette used automatically when the theme is enabled.

An accessible text-contrast variant is available when categorical colors are applied to text rather than marks:

attaviz.CATEGORICAL       # 9-color palette (default)
attaviz.CATEGORICAL_TEXT  # high-contrast text variant
attaviz.BINARY            # two-color pair

Sequential

Six monochrome ramps. Use with alt.Scale(range=...):

alt.Chart(data).mark_rect().encode(
    color=alt.Color("value:Q", scale=alt.Scale(range=attaviz.SEQ_GREEN))
)

Two semantic sequential ramps convey “good → bad” direction:

Diverging

Three diverging palettes with a neutral midpoint (#EFEFEF). Pair with domainMid=0 for symmetric scales centered at zero:

alt.Chart(data).mark_bar().encode(
    color=alt.Color(
        "change:Q",
        scale=alt.Scale(range=attaviz.DIV_DEFAULT, domainMid=0),
    )
)

Semantic palettes

Regions

attaviz.REGIONS            # code → hex (e.g. "NAC", "SSF", ...)
attaviz.REGIONS_TEXT       # accessible text variants
attaviz.REGIONS_SECONDARY  # 4-shade series per region

Use in an explicit scale:

regions = attaviz.REGIONS
alt.Chart(data).mark_bar().encode(
    color=alt.Color(
        "region:N",
        scale=alt.Scale(domain=list(regions), range=list(regions.values())),
    )
)

Income groups

attaviz.INCOME       # dict: "HIC", "UMC", "LMC", "LIC" → hex
attaviz.INCOME_LIST  # ordered list (HIC → LIC)

Demographics

attaviz.GENDER        # dict: "female", "male", ...
attaviz.URBANIZATION  # dict: "urban", "rural"
attaviz.AGE           # list, youngest → oldest (5 shades)

Pillars

Institutional pillar colors.

attaviz.PILLARS
# {'people': '#F7B841', 'planet': '#07AB50', 'prosperity': '#872C8F',
#  'infrastructure': '#91302F', 'digital': '#5D6472', 'corporate': '#004972'}

Grey scale

Five greys used across the theme.

Constant Hex Typical use
GREY_500 #111111 primary text
GREY_400 #666666 secondary text
GREY_300 #8A969F reference lines
GREY_200 #CED4DE grid lines
GREY_100 #EBEEF4 backgrounds

Functional

attaviz.REFERENCE            # "#8A969F" — reference line color
attaviz.NO_DATA              # "#CED4DE" — missing-data fill
attaviz.TOTAL                # "#163C6C" — total/aggregate color
attaviz.SELECTION_PRIMARY    # "#0071BC" — active selection
attaviz.SELECTION_SECONDARY  # companion selection color
attaviz.TEXT                 # primary text color
attaviz.TEXT_SUBTLE          # subtle text color (captions)