Skip to content

Styling data

Halo, glow and mask

Three effects: a soft glow along features, light that adds up where features overlap, and a spotlight on a site.

Quick reference

Utility Does Example
halo-<colour> A soft glow around outlines, lines or points halo-cyan-300
halo-white/60
glow Colours add up where features overlap; for dark basemaps glow
mask-<colour> Cover everything outside this layer's polygons, to spotlight a site mask-white/80
mask-slate-950/60

Halo

Faint, wide bands under outlines, lines or points. Halos ignore the mouse, so tooltips still reach the layer.

kh.map(states, "theme-midnight fill-transparent stroke-cyan-300 stroke-1 halo-cyan-400/60")

Glow

glow switches the map to additive blending: where features overlap, colours add up and brighten, which traces dense clusters. It is map-wide and made for dark basemaps; on a light basemap most features turn white, and kharita warns.

kh.map(quakes, "theme-neon fill-fuchsia-400/50 size-3 glow legend-none")

Mask

mask-white/85 on a polygon layer covers everything outside its polygons, the spotlight used in site reports. The layer's own outline still draws on top. Masks need polygons; on lines and points they are ignored with a warning.

mask

m = kh.Map(basemap="silver")
m.add(roads, "stroke-[road_class] ramp-zoning width-[rank] width-max-3 legend-none")
m.add(site, "fill-transparent stroke-[#e6745c] stroke-2 mask-white/85")
m