This is the documentation of version 0.59.0. Go to the latest version, 1.0.0-rc.5.
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, with near-identical clusters merged. 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[]