1.
# Spectrum
2.
## The No Hassle Colorpicker
3.
4.
See the demo and docs: http://bgrins.github.io/spectrum.
5.
6.
I wanted a colorpicker that didn't require images, and that had an API that made sense to me as a developer who has worked with color in a number of applications. I had tried a number of existing plugins, but decided to try and make a smaller, simpler one.
7.
8.
I started using canvas, then switched to CSS gradients, since it turned out to be easier to manage, and provided better cross browser support.
9.
10.
### Basic Usage
11.
12.
Head over to the [docs](http://bgrins.github.io/spectrum) for more information. There is a visual demo of the different options hosted at: http://bgrins.github.io/spectrum.
13.
14.
<script src='spectrum.js'></script>
15.
<link rel='stylesheet' href='spectrum.css' />
16.
17.
<input id='colorpicker' />
18.
19.
<script>
20.
$("#colorpicker").spectrum({
21.
color: "#f00"
22.
});
23.
</script>
24.
25.
### npm
26.
27.
Spectrum is registered as package with npm. It can be installed with:
28.
29.
npm install spectrum-colorpicker
30.
31.
### Bower
32.
33.
Spectrum is registered as a package with [Bower](http://bower.io/), so it can be pulled down using:
34.
35.
bower install spectrum
36.
37.
### Using spectrum with a CDN
38.
39.
CDN provided by [cdnjs](https://cdnjs.com/libraries/spectrum)
40.
41.
<script src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.1/spectrum.min.js"></script>
42.
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.1/spectrum.min.css">
43.
44.
### Continuous Integration
45.
46.
[](http://travis-ci.org/bgrins/spectrum)
47.
48.
Visit https://travis-ci.org/bgrins/spectrum to view the status of the automated tests.
49.
50.
### Building Spectrum Locally
51.
52.
If you'd like to download and use the plugin, head over to http://bgrins.github.io/spectrum/ and click the 'Download Zip' button.
53.
54.
If you'd like to run the development version, spectrum uses Grunt to automate the testing, linting, and building. Head over to http://gruntjs.com/getting-started for more information. First, clone the repository, then run:
55.
56.
npm install -g grunt-cli
57.
npm install
58.
59.
# runs jshint and the unit test suite
60.
grunt
61.
62.
# runs jshint, the unit test suite, and builds a minified version of the file.
63.
grunt build
64.
65.
### Internationalization
66.
67.
If you are able to translate the text in the UI to another language, please do! You can do so by either [filing a pull request](https://github.com/bgrins/spectrum/pulls) or [opening an issue]( https://github.com/bgrins/spectrum/issues) with the translation. The existing languages are listed at: https://github.com/bgrins/spectrum/tree/master/i18n.
68.
69.
For an example, see the [Dutch translation](i18n/jquery.spectrum-nl.js).
70.