From c906e16fece10208b78c469d4c6457a00eff310e Mon Sep 17 00:00:00 2001 From: Lokesh Dhakar Date: Thu, 3 Nov 2011 18:04:23 -0400 Subject: [PATCH] more rm updates --- README.markdown | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/README.markdown b/README.markdown index 41a9e2e..e5e96d2 100644 --- a/README.markdown +++ b/README.markdown @@ -1,17 +1,9 @@ -# Color Thief -by Lokesh Dhakar - [Blog](http://lokeshdhakar.com) - [Twitter](http://twitter.com/lokeshdhakar) - -A script for grabbing the dominant color or a representative color palette from an image. Uses javascript and canvas. - -[**See a Demo**](http://lokeshdhakar.com/projects/color-thief) - -###Requirements -* jQuery -* quantize.js +## Color Thief +A script for grabbing the dominant color or a representative color palette from an image. Uses javascript and canvas. [**See a Demo**](http://lokeshdhakar.com/projects/color-thief) ###Usage -####Dominant Color +####Get Dominant Color ```js getDominantColor(sourceImage) ``` @@ -20,15 +12,17 @@ returns {r: num, g: num, b: num} Uses the median cut algorithm provided by quantize.js to cluster similar colors and return the base color from the largest cluster. -####Palette +####Create Palette ```js createPalette(sourceImage, colorCount) -returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...] + ``` +returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...] Use the median cut algorithm provided by quantize.js to cluster similar colors. BUGGY: Function does not always return the requested amount of colors. It can be +/- 2. +###License Licensed under the [Creative Commons Attribution 2.5 License](http://creativecommons.org/licenses/by/2.5/) \ No newline at end of file