color-thief

Grab the color palette from an image using just Javascript. Works in the browser and in Node.

MIT License

Downloads
258.5K
Stars
12.2K
Committers
18

Bot releases are visible (Hide)

color-thief - v2.4.0 Latest Release

Published by lokesh over 1 year ago

What's Changed

Full Changelog: https://github.com/lokesh/color-thief/compare/v2.3.2...v2.4.0

color-thief - v2.3.2

Published by lokesh over 4 years ago

fix: Use image naturalHeight and naturalHeight #182 Thanks to @wangcheng

color-thief - v2.3.1

Published by lokesh over 4 years ago

  • #191 fix: quality option validation. Thanks to @Aaron-hanson Issue
  • chore: Fix npm script command syntax. Thanks again to @Aaron-hanson
  • tests: Add test for CORS
  • docs: Move contributing info inline in README. Add proj structure and more info around testing.
color-thief -

Published by lokesh about 5 years ago

  • feat: Node support. Use color-thief-node.js file in dist folder
  • test: Added simple tests for node env with Mocha and Chai to go alongside the Cypress browser tests
  • build: Discontinue outputting sourcemaps

Example node usage:

const { resolve } = require('path');
const ColorThief = require('colorthief');
const img = resolve(process.cwd(), 'night.jpg');

ColorThief.getColor(img)
	.then((color) => {
		console.log(color);
	})
color-thief -

Published by lokesh about 5 years ago

  • fix: Remove node version requirement
  • refactor: Create sep repo for quantize lib and import
  • refactor: Use a shared core lib
  • test: Enable other palette count tests post-quantize func updates
  • test: Remove bad test case, colorcount(1)
  • wip: node support. see src/color-thief-node.js
color-thief -

Published by lokesh over 5 years ago

Highlights

  • feat: Add CommonJS, AMD, and ES6 module support #161 (Note: Does not work in Node env because of <canvas> tag req in browser, but this is first step towards adding support.)

Other changes

  • Replace uglify with microbundle for build step
  • Add test for es6 module loading
color-thief -

Published by lokesh over 5 years ago

Highlights

  • Add Cypress for browser testing
  • Removes grunt and bower

Changelog

  • chore: Remove Grunt. Use npm tasks. PR #145
  • chore: Discontinue Bower support. PR #146
  • chore: Add eslint. PR #151
  • test: Add Cypress for browser testing PR #146
  • test: Add browsertests: getColor on black, red, and multi-color image. PR #146
  • refactor: Don't append canvas tag to DOM #150
  • docs: Strip included example page to essentials. PR #146
  • style: tabs to spaces. PR #146
  • feat: Add demo page. PR #158
color-thief - MIT License plus MMCQ fixes

Published by lokesh about 9 years ago

  • [Fix] Remove left-over references to Creative Commons License. MIT all-around.
  • [Fix] MMCQ lib issues #16 by @nobodypb
  • [Fix] Incorrect bower.json main property path. #37 by @chellem, @joscha, @dkushner
  • [Fix] Quality less than 1 causes infinite loop #33 by @nteike
  • [Fix] MMCQ.quantize(...) can return false or undefined thus breaking the application #55 by @mhahmadi
  • [Remove] Drop version number from bower.json #70 by @kkirsche
color-thief - v2.0

Published by lokesh about 11 years ago

Script changes

  • Remove jQuery requirement
  • Embed quantize methods directly in color-thief.js
  • Speed improvements to algorithm including the addition of an optional 'quality' parameter in the getPalette method

Demo page changes

  • Examples now interactive; click to run
  • Added drag'n'drop demo