> For the complete documentation index, see [llms.txt](https://developers.felt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.felt.com/felt-style-language/colors-and-palettes.md).

# 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:

1. **A literal color** — a hex, HSL, or RGB string.
2. **A smart color** — the keyword `"auto"`, which Felt resolves to a contrasting color at render time.
3. **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:

```json
{
  "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"` 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:

* `strokeColor` on points and polygons
* `color` and `haloColor` on labels

…unless a specific color has been requested.

```json
{
  "paint": {
    "color": "#8F7EBF",
    "strokeColor": "auto",
    "strokeWidth": 1
  },
  "label": {
    "color": "auto",
    "haloColor": "auto",
    "haloWidth": 1.5
  }
}
```

## 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.

{% hint style="info" %}
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.

The families below are guidance, not rules: Felt doesn't check a palette against the visualization type, so any palette name works in any color property.
{% endhint %}

### Vector palettes

Used by categorical, numeric, heatmap, and H3 visualizations on points, lines, and polygons.

#### Sequential (low → high)

| Palette      | Description                    |
| ------------ | ------------------------------ |
| `@galaxy`    | Pale yellow-green to dark teal |
| `@ylRed`     | Yellow to red                  |
| `@ylGrn`     | Yellow to green                |
| `@purpYl`    | Yellow to purple               |
| `@pinkYl`    | Yellow to pink                 |
| `@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)

| Palette   | Description                      |
| --------- | -------------------------------- |
| `@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)

| Palette                         | Description                    |
| ------------------------------- | ------------------------------ |
| `@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`. Every sequential and diverging vector palette has variants for 2 through 9 colors. 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.

| Palette          | Description                                |
| ---------------- | ------------------------------------------ |
| `@geyser`        | Green → beige → orange → red               |
| `@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

| Palette          | Description                                                                           |
| ---------------- | ------------------------------------------------------------------------------------- |
| `@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 — note the spelling: `mpa`, not `mpl`                              |
| `@mplPlasma`     | Matplotlib plasma                                                                     |
| `@mplVirdis`     | Matplotlib viridis, perceptually uniform — note the spelling: `Virdis`, not `Viridis` |
| `@cividis`       | Cividis — colorblind-safe                                                             |
| `@feltYlRed`     | Felt red to yellow                                                                    |
| `@veg`           | Vegetation gradient                                                                   |

#### Diverging

| Palette        | Description                            |
| -------------- | -------------------------------------- |
| `@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

| Palette        | Description                |
| -------------- | -------------------------- |
| `@terrain`     | Terrain elevation gradient |
| `@rTerrain`    | R terrain gradient         |
| `@feltHypso`   | Felt hypsometric tints     |
| `@wikiTerrain` | Wikipedia terrain gradient |

#### Vegetation

| Palette     | Description                |
| ----------- | -------------------------- |
| `@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: true` and an explicit `categories` array, 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](https://en.wikipedia.org/wiki/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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.felt.com/felt-style-language/colors-and-palettes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
