• Stars
    star
    2,315
  • Rank 19,886 (Top 0.4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The No Hassle JavaScript Colorpicker

Spectrum

The No Hassle Colorpicker

See the demo and docs: http://bgrins.github.io/spectrum.

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.

I started using canvas, then switched to CSS gradients, since it turned out to be easier to manage, and provided better cross browser support.

Basic Usage

Head over to the docs for more information. There is a visual demo of the different options hosted at: http://bgrins.github.io/spectrum.

<script src='spectrum.js'></script>
<link rel='stylesheet' href='spectrum.css' />

<input id='colorpicker' />

<script>
$("#colorpicker").spectrum({
    color: "#f00"
});
</script>

npm

Spectrum is registered as package with npm. It can be installed with:

npm install spectrum-colorpicker

Bower

Spectrum is registered as a package with Bower, so it can be pulled down using:

bower install spectrum

Using spectrum with a CDN

CDN provided by cdnjs

<script src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.css">

Continuous Integration

Build Status

Visit https://travis-ci.org/bgrins/spectrum to view the status of the automated tests.

Building Spectrum Locally

If you'd like to download and use the plugin, head over to http://bgrins.github.io/spectrum/ and click the 'Download Zip' button.

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:

npm install -g grunt-cli
npm install

# runs jshint and the unit test suite
grunt

# runs jshint, the unit test suite, and builds a minified version of the file.
grunt build

Internationalization

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 or opening an issue with the translation. The existing languages are listed at: https://github.com/bgrins/spectrum/tree/master/i18n.

For an example, see the Dutch translation.

More Repositories

1

TinyColor

Fast, small color manipulation and conversion for JavaScript
JavaScript
5,040
star
2

devtools-snippets

A collection of helpful snippets to use inside of browser devtools
HTML
2,958
star
3

videoconverter.js

[UNMAINTAINED] Convert videos in your browser
JavaScript
2,344
star
4

javascript-astar

A* Search / Pathfinding Algorithm in Javascript
JavaScript
1,307
star
5

filereader.js

A lightweight wrapper for the JavaScript FileReader interface
JavaScript
413
star
6

ExpandingTextareas

jQuery plugin for elegant expanding textareas
JavaScript
261
star
7

bindWithDelay

jQuery Plugin For Delayed Event Execution
JavaScript
151
star
8

InstantSprite

A fast browser based CSS Sprite Generator
JavaScript
141
star
9

nativesortable

Use native drag and drop APIs to provide sortable items. No dependancies.
JavaScript
87
star
10

colorwheel-1k

HSV colorpicker entry for js1k
JavaScript
31
star
11

ui.anglepicker

A jQuery UI Angle Picker Widget
JavaScript
30
star
12

DrawWindow

A Javascript implementation for canvas.drawWindow
JavaScript
29
star
13

devtools-demos

JavaScript
18
star
14

window-performance

A small JavaScript plugin to view the window.performance data
JavaScript
15
star
15

browser-diff

Get the differences between text files
JavaScript
15
star
16

xbl-analysis

HTML
13
star
17

codemirror-accessible

JavaScript
9
star
18

musicviz

A Canvas / Audio Experiment
JavaScript
9
star
19

wordsolver.js

Unscramble words in browser with a variety of dictionaries
JavaScript
8
star
20

inverse-intersection

Given a parent rectangle and a collection of children rectangles on a 2D plane, find a collection of non-overlapping rectangles that cover the inverse of the original set.
JavaScript
8
star
21

ColorStash

JavaScript
6
star
22

webdesigner

A totally unfinished visual web page editor...
JavaScript
5
star
23

photo-editor

JavaScript
5
star
24

neon-mentat

JavaScript
5
star
25

esm_sandbox_eval

JavaScript
4
star
26

arewefissionyet

JavaScript
3
star
27

firefox-patches

Patch queue for Firefox
3
star
28

bgrins.github.com

My Github Page
HTML
3
star
29

html5-workshop

Content to go along with ComoRichWeb workshop night for learning HTML5
3
star
30

sqlite-datagrid-demo

JavaScript
2
star
31

image-editor-scaffold

Experimental image editor project scaffold. Not ready for prime time in any way
JavaScript
2
star
32

firefox-user-testing-helpers

Batchfile
2
star
33

asciigram

JavaScript
2
star
34

data-ui-tests

HTML
2
star
35

table_to_csv

Convert HTML table to CSV
HTML
2
star
36

unicode_searcher

search for unicode characters
JavaScript
1
star
37

webdata

JavaScript
1
star
38

console-output-experiment

JavaScript
1
star
39

-super-spork

JavaScript
1
star
40

caption-o-matic

CSS
1
star
41

xul-document-burndown

JavaScript
1
star
42

component-prototype

JavaScript
1
star
43

bug-tools

Some scripts for working with bugzilla and commits to mozilla-central
JavaScript
1
star
44

comorichweb

JavaScript
1
star
45

colorwheel-full

1
star
46

rust-ci-starter

Rust
1
star
47

marquee-test

HTML
1
star
48

areweyet

Shared code for arewe*yet sites
JavaScript
1
star
49

Original_DrawWindow_Development

Render HTML in the Canvas Element
PHP
1
star
50

imgedit

Playing around with canvas... totally unfinished
JavaScript
1
star
51

ColorStashMini

A devtools playground for talks
JavaScript
1
star
52

opfs-sqlite-demo

JavaScript
1
star
53

kitchen-sink

JavaScript
1
star
54

webdev-sandbox

TypeScript
1
star
55

editor-tests

JavaScript
1
star
56

benchmark-reporting-server

JavaScript
1
star
57

crossbrowser-selenium-action-test

JavaScript
1
star
58

alt-text-test-results

HTML
1
star
59

compat-utils

JavaScript
1
star