forked from lokesh/color-thief
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·126 lines (107 loc) · 4.17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!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="Get the dominant color or color palette from an image.">
<meta name="author" content="Lokesh Dhakar">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Karla%7CMontserrat:700">
<link rel="stylesheet" href="examples/css/screen.css">
</head>
<body>
<header>
<div class="container">
<h1 class="logo">Color Thief</h1>
<p class="lead">
Grab the color palette from an image.<br /> Uses Javascript and the canvas tag to make it happen.
</p>
<a href="https://github.com/lokesh/color-thief/" class="button">
Download from Github</small>
</a>
</div>
</header>
<section id="examples" class="examples-section">
<div class="container">
<h2>Examples</h2>
<div id="example-images"></div>
</div>
</section>
<section id="drag-drop" class="drag-drop-section">
<div class="container">
<h2>Try it yourself</h2>
<div id="drop-zone" class="drop-zone">
<div class="drop-zone-label default-label">Drag an image here</div>
<div class="drop-zone-label dragging-label">Drop it!</div>
</div>
<div id="dragged-images" class="dragged-images"></div>
</div>
</section>
<footer>
<div class="container">
<p>
Created by Lokesh Dhakar<br />
<a href="https://twitter.com/lokesh" class="button button-minor">Follow me on Twitter</a>
</p>
</div>
</footer>
<div id="sharing" class="sharing-section">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="lokesh" data-size="large">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<!-- Mustache templates -->
<script id='image-section-template' type='text/x-mustache'>
{{#images}}
<div class="image-section {{class}}">
<div class="image-wrap">
<button class="run-functions-button">
<span class="no-touch-label">Click</span>
<span class="touch-label">Tap</span>
</button>
<img class="target-image" src="{{file}}" />
</div>
<div class="color-thief-output"></div>
</div>
{{/images}}
</script>
<script id="color-thief-output-template" type="text/x-mustache">
<div class="function get-color">
<h3 class="function-title">Dominant Color</h3>
<div class="swatches">
<div class="swatch" style="background-color: rgb({{color.0}}, {{color.1}}, {{color.2}})"></div>
</div>
<div class="function-code">
<code>colorThief.getColor(image):{{elapsedTimeForGetColor}}ms</code>
</div>
</div>
<div class="function get-palette">
<h3 class="function-title">Palette</h3>
<div class="function-output">
<div class="swatches">
{{#palette}}
<div class="swatch" style="background-color: rgb({{0}}, {{1}}, {{2}})"></div>
{{/palette}}
</div>
</div>
<div class="function-code">
<code>colorThief.getPalette(image):{{elapsedTimeForGetPalette}}ms</code>
</div>
</div>
</script>
<script src="src/color-thief.js"></script>
<script src="examples/js/jquery.js"></script>
<script src="examples/js/mustache.js"></script>
<script src="examples/js/demo.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2196019-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>