A Javascript color library. Quickly manipulate and convert colors.
JavaScript CoffeeScript HTML
Latest commit ddacb89 Jun 18, 2016 @avp Clean tests.
Failed to load latest commit information.
dist Prepare for release of 0.2.0. Feb 4, 2014
test Clean tests. Jun 18, 2016
.coveralls.yml Add coverage tests. Dec 6, 2013
.gitignore Add spectra.min.js for Bower. Jul 30, 2014
.travis.yml Remove coverity. Jun 18, 2016
Gruntfile.coffee Update coverage_dir to coverageDir. Jun 18, 2016
LICENSE Initial commit Aug 12, 2013
README.md Remove coverity. Jun 18, 2016
bower.json Update bower.json. Feb 16, 2014
index.html Add spectra. Aug 12, 2013
karma-dev.conf.js Update build system. Jun 23, 2014
karma-prod.conf.js Update build system. Jun 23, 2014
package.json Update npm dependencies. Jun 12, 2016
spectra.js Update npm dependencies. Jun 12, 2016
spectra.min.js Update npm dependencies. Jun 12, 2016
spectra.sublime-project Add tests. Aug 13, 2013



Build Status Coverage Status devDependency Status npm Version GA Beacon

A small Javascript library for quickly manipulating and converting colors.


Spectra can be wrapped around many different types of objects to create a Spectra color that can be manipulated.

var color = Spectra({r: 255, g: 25, b: 75});
color.red() // 255


The project was created to have a highly functional and lightweight way to deal with colors using Javascript, without any dependencies.


Simply download spectra.min.js and include it before your source files.


The bower package is at spectrajs.

bower install spectrajs


This module also works with Node. Simply run npm install spectra and use var Spectra = require('spectra') to set it up.

API Reference

Refer to http://avp.github.io/spectra for reference on how to use Spectra.


There are Jasmine tests included in the tests folder. Simply run grunt test from the root of the repository to run the tests. This also checks JSHint. Alternatively, run grunt to keep watch over source and test files, and automatically rerun the tests when the files change.


Test coverage information can be generated by running grunt karma. Coverage information will be located in test/coverage after generation.


To minify Spectra, run grunt build.


View CONTRIBUTING.md for guidelines on how to contribute.