---
title: "getAdaptiveColorsForStyle | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Function getAdaptiveColorsForStyle

-   getAdaptiveColorsForStyle(styleId: string): [AdaptiveColorSet](https://docs.maptiler.com/sdk-js/api-reference/types/AdaptiveColorSet/)[](#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](https://docs.maptiler.com/sdk-js/api-reference/types/AdaptiveColorSet/)
    
    The style's colour set. The object is frozen and shared, so spread it to modify a copy.
    
    #### Example[](#example)
    
    ```typescript
    getAdaptiveColorsForStyle("streets-v4-dark").innerColor; // "#4D97FF"
    ```
    
    #### Example[](#example-1)
    
    ```typescript
    getAdaptiveColorsForStyle("my-custom-style"); // falls back to the `base` colours
    ```
