TomTom Maps for JavaScript
    Preparing search index...

    Variable dominantColorsConst

    dominantColors: (pixels: ImagePixels, count?: number) => string[]

    The dominant colours of an image, largest area first, as hex strings. A small k-means over a sample of opaque pixels finds them, merging near-identical clusters. Feed the result to deriveMapColors. deriveMapColorsFromImage does both.

    Type Declaration

      • (pixels: ImagePixels, count?: number): string[]
      • Parameters

        • pixels: ImagePixels
        • Optionalcount: number

          The most colours to return (default 6). Merged clusters can leave fewer.

        Returns string[]