# dominantcolors.js **Repository Path**: mirrors_alienzhou/dominantcolors.js ## Basic Information - **Project Name**: dominantcolors.js - **Description**: Extract dominant colors from image. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-22 - **Last Updated**: 2026-05-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## dominantcolors.js ![npm-image](http://img.shields.io/npm/v/dominantcolors.js.svg) [![Build Status](https://travis-ci.org/hunnble/dominantcolors.js.svg?branch=master)](https://travis-ci.org/hunnble/dominantcolors.js) ![downloads-image](http://img.shields.io/npm/dw/dominantcolors.js.svg) ![downloads-image](http://img.shields.io/npm/dm/dominantcolors.js.svg) ![downloads-image](http://img.shields.io/npm/dy/dominantcolors.js.svg) ![downloads-image](http://img.shields.io/npm/dt/dominantcolors.js.svg) > Extract dominant colors from image. [source code](https://github.com/hunnble/dominantcolors.js) | [docs](https://hunnble.github.io/dominantcolors.js) | [online examples](https://hunnble.github.io/dominantcolors.js/example/example.html) ### install install dominantcolors.js via yarn ```sh yarn add dominantcolors.js ``` you can also use [unpkg](https://unpkg.com/), just replace "version" with the current version on the link below: ```html ``` ### quick start ```javascript const dominantcolorsJs = require("dominantcolors.js"); dominantcolorsJs("./example.jpg", { count: 4, omitTransparentPixel: true, colorFormat: "hex" // hex or rgb }) .then(result => { // result is an array of colors // eg: ['#4B2A29', '#180C0C', '#582929', '#160808'] }) .catch(error => { // handle the error }); ```