For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Function getAdaptiveColorsForStyle

  • Resolves the default (adaptive) colours for a given map style.

    Lookup order: exact style key (version stripped, variant kept) → reference style without variant → base, so an unknown style id resolves to base.

    Parameters

    • styleId: string

      Style id, versioned ("streets-v4-dark") or not ("streets-dark").

    Returns AdaptiveColorSet

    The style's colour set. The object is frozen and shared, so spread it to modify a copy.

    getAdaptiveColorsForStyle("streets-v4-dark").innerColor; // "#4D97FF"
    
    getAdaptiveColorsForStyle("my-custom-style"); // falls back to the `base` colours
    
Was this helpful?