mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 05:44:24 +00:00
- Updated to higher res demo images. - Split template into two. - Style clean up in color-thief.js
91 lines
2.8 KiB
HTML
Executable File
91 lines
2.8 KiB
HTML
Executable File
<!doctype html>
|
|
<html class="no-js" lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
|
<title>Color Thief</title>
|
|
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<script src="js/libs/modernizr-2.0.6.min.js"></script>
|
|
<link href='http://fonts.googleapis.com/css?family=Karla:400,700|Cousine' rel='stylesheet' type='text/css'>
|
|
<link rel="stylesheet" href="css/app.css">
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<div class="wrapper">
|
|
|
|
<section class="intro">
|
|
<h1>Color Thief</h1>
|
|
<h4><a href="http://lokeshdhakar.com">by Lokesh Dhakar</a></small></h4>
|
|
|
|
<p class="description">A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.</p>
|
|
<p><a href="http://www.lokeshdhakar.com/color-thief/">Read more about it on my blog</a> or <a href="https://github.com/lokesh/color-thief">get the code on Github</a>
|
|
</p>
|
|
</section>
|
|
|
|
<section class="examples" id="examples">
|
|
<h2>Examples</h2>
|
|
</section>
|
|
|
|
<sectcion class="drag-and-drop" id="dragDrop">
|
|
<h2>Try it yourself</h2>
|
|
<div id="dropZone" class="dropZone">
|
|
</div>
|
|
<div id="draggedImages"></div>
|
|
</div>
|
|
|
|
</div> <!--! end of #container -->
|
|
|
|
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.8.3.min.js"><\/script>')</script>
|
|
<script src="js/libs/jquery.lettering.js"></script>
|
|
<script src="js/libs/mustache.js"></script>
|
|
|
|
<script src="js/libs/quantize.js"></script>
|
|
<script src="js/color-thief.js"></script>
|
|
|
|
<!-- Using Mustache for templating -->
|
|
<script id='image-section-template' type='text/x-mustache'>
|
|
{{#images}}
|
|
<div class="image-section {{class}} ">
|
|
<div class="image-wrap">
|
|
<button class="run-functions-button">Click</button>
|
|
<img class="target-image" src="{{file}}" data-colorcount="{{colorCount}}" />
|
|
</div>
|
|
<div class="color-thief-output-template"></div>
|
|
</div>
|
|
{{/images}}
|
|
</script>
|
|
|
|
<script id='color-thief-output-template' type='text/x-mustache'>
|
|
<div class="function get-color">
|
|
<div class="function-details">
|
|
<h3 class="function-title">Dominant Color</h3>
|
|
<div class="function-code">colorThief.getColor()</div>
|
|
<div class="function-execution-time">20ms</div>
|
|
</div>
|
|
<div class="function-output">
|
|
<div class="swatches"></div>
|
|
</div>
|
|
</div>
|
|
<div class="function get-palette">
|
|
<div class="function-details">
|
|
<h3 class="function-title">Palette</h3>
|
|
<div class="function-code">colorThief.getPalette()</div>
|
|
<div class="function-execution-time">20ms</div>
|
|
</div>
|
|
<div class="function-output">
|
|
<div class="swatches"></div>
|
|
</div>
|
|
</div>
|
|
</script>
|
|
|
|
<script src="demo.js"></script>
|
|
|
|
</body>
|
|
</html>
|