GithubHelp home page GithubHelp logo

cheapsteak / color-thief Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lokesh/color-thief

0.0 2.0 0.0 1.64 MB

Grabs the dominant color or a representative color palette from an image. Uses javascript and canvas.

Home Page: https://github.com/lokesh/color-thief

License: MIT License

JavaScript 75.71% CSS 18.15% HTML 6.14%

color-thief's Introduction

#Color Thief

A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.

See a Demo | Read more on my blog

##How to use

###Get the dominant color from an image

var colorThief = new ColorThief();
colorThief.getColor(sourceImage);
getColor(sourceImage[, quality])
returns {r: num, g: num, b: num}

###Build a color palette from an image

In this example, we build an 8 color palette.

var colorThief = new ColorThief();
colorThief.getPalette(sourceImage, 8);
getPalette(sourceImage[, colorCount, quality])
returns [ [num, num, num], [num, num, num], ... ]

Changelog

v2.0.1 - UNRELEASED

  • [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)[lokesh#55] by @mhahmadi
  • [Remove] Drop version number from bower.json #70 by @kkirsche

v2.0.0 - 2013-06-23

  • Embed quantize into color thief file
  • Strip out jQuery requirement
  • Credit those who helped with edits - Nathan Spady for drag and drop support.

color-thief's People

Contributors

chellem avatar dkushner avatar joscha avatar kkirsche avatar kraftner avatar lokesh avatar mhahmadi avatar michaelhart avatar nobodypb avatar nspady avatar nteike avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.