Colors & palettes
Colors appear throughout the Felt Style Language — in paint (color, strokeColor), in label (color, haloColor), and in legends. There are three ways to express a color:
A literal color — a hex, HSL, or RGB string.
A smart color — the keyword
"auto", which Felt resolves to a contrasting color at render time.A palette shortcut — a named, multi-color ramp like
@galaxy, used by data-driven (categorical, numeric, heatmap, H3) visualizations.
Literal colors
Any of these string formats are accepted wherever a single color is expected:
{
"color": "#3B82F6",
"strokeColor": "hsl(217, 80%, 40%)",
"haloColor": "rgb(38, 113, 0)"
}rgba(...) is also supported and is handy for fully-transparent fills (for example, a transparent "Other"/background class in a categorical raster: "rgba(0, 0, 0, 0)").
Smart color: "auto"
"auto""auto" computes a contrasting color automatically, based on the current map theme and the colors around it. It keeps strokes and label halos legible without hard-coding a value that might clash on a dark basemap or against a particular fill.
Prefer "auto" for:
strokeColoron points and polygonscolorandhaloColoron labels
…unless a specific color has been requested.
Palette shortcuts
For any data-driven visualization, prefer a named palette over a hand-built color array. Palettes are referenced with an @ prefix (for example "color": "@galaxy") and Felt expands them to the right number of colors for your classes or categories.
Only the palette names listed below are valid. Use sequential palettes for single-direction data (population, elevation), and diverging palettes for data with a meaningful midpoint (change from a baseline, temperature anomaly). Reserve literal hex/HSL colors for simple (uniform) styles or when a specific color is requested.
Vector palettes
Used by categorical, numeric, heatmap, and H3 visualizations on points, lines, and polygons.
Sequential (low → high)
@galaxy
Purple to yellow (popular default)
@ylRed
Yellow to red
@ylGrn
Yellow to green
@purpYl
Purple to yellow
@pinkYl
Pink to yellow
@lightning
Lightning gradient
@copper
Copper gradient
@spruce
Spruce green
@riverine
Water gradient
@neptune
Blue gradient
@violet
Violet gradient
@purple
Purple gradient
Diverging (two directions from a center)
@bluRd
Blue to red
@tealOr
Teal to orange (colorblind-safe)
@bluBr
Blue to brown
@grnOr
Green to orange
@purGrn
Purple to green
@weath
Weather gradient
Categorical (distinct colors)
@catPalette1 … @catPalette7
Categorical color schemes
@catPalettePT1
Paul Tol categorical palette 1
@catPalettePT2
Paul Tol categorical palette 2
Sequential and diverging vector palettes also come in numbered variants that request a specific number of colors — for example @galaxy7, @galaxy8, @galaxy9. Variants exist for 7, 8, and 9 colors (@lightning also has a 6-color variant). The unnumbered name lets Felt pick the right count for you, which is usually what you want.
Heatmap palettes
Used by heatmap visualizations, ordered from least to most density.
@geyser
Green → beige → orange → red (default)
@redOrHeat
Yellow → orange → red → magenta
@purpYlHeat
Light yellow → coral → pink → purple
@lightningHeat
Purple → teal → green → yellow
@ylGrnHeat
Dark teal → green → yellow
@bluRdHeat
Blue → gray → red (diverging feel)
@tealRedHeat
Teal → green → yellow → orange → pink
@purpYlPink
Purple → teal → yellow → orange → red/pink
Raster palettes
Used by numeric, hillshade, and raster-algebra visualizations.
Sequential
@feltGrays
Grayscale gradient
@cbBlues
ColorBrewer blues
@cbPurples
ColorBrewer purples
@feltPinks
Pink gradient
@cmOceanGreens
Ocean greens gradient
@pattFeltOcean
Teal ocean gradient
@cmOceanDeep
Deep ocean gradient
@mpaInferno
Matplotlib inferno
@mplPlasma
Matplotlib plasma
@mplVirdis
Matplotlib viridis — perceptually uniform
@cividis
Cividis — colorblind-safe
@feltYlRed
Felt yellow to red
@veg
Vegetation gradient
Diverging
@feltWeath
Felt weather gradient
@feltHeat
Felt heat gradient
@feltVibrant
Felt vibrant gradient
@nclBlOrRed
NCL blue-orange-red diverging
@cbRedYlGrn
ColorBrewer red-yellow-green diverging
@cbBrBG
ColorBrewer brown-blue-green diverging
Terrain
@terrain
Terrain elevation gradient
@rTerrain
R terrain gradient
@feltHypso
Felt hypsometric tints
@wikiTerrain
Wikipedia terrain gradient
Vegetation
@nasaNDVI
NASA NDVI vegetation index
For raster categorical layers, use the vector categorical palettes above (@catPalette1 … @catPalette7, @catPalettePT1, @catPalettePT2).
Raster palettes also support numbered variants to request a specific number of steps — for example @feltGrays2, @feltGrays3, … @feltGrays9.
How colors map to classes
When a palette or color array drives a data-driven visualization, the number of colors should line up with the number of classes or categories:
Categorical: one color per category. With
showOther: trueand an explicitcategoriesarray, provide N + 1 colors — the extra one styles the "Other" bucket.Classed numeric: N break points produce N − 1 classes, so an explicit color array needs N − 1 entries.
Continuous: provide 2 or more colors and Felt interpolates smoothly between them in the HCL color space.
A palette shortcut handles all of this for you — Felt expands @galaxy to exactly the colors it needs. Reach for explicit arrays only when you want precise control over each color.
Last updated
Was this helpful?