Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avp/spectra
A Javascript color library. Quickly manipulate and convert colors.
https://github.com/avp/spectra
color convert-colors javascript javascript-library nodejs spectra
Last synced: 19 days ago
JSON representation
A Javascript color library. Quickly manipulate and convert colors.
- Host: GitHub
- URL: https://github.com/avp/spectra
- Owner: avp
- License: mit
- Created: 2013-08-13T06:37:12.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T19:01:43.000Z (almost 7 years ago)
- Last Synced: 2024-10-12T07:21:05.689Z (about 1 month ago)
- Topics: color, convert-colors, javascript, javascript-library, nodejs, spectra
- Language: JavaScript
- Homepage: avp.github.io/spectra
- Size: 553 KB
- Stars: 237
- Watchers: 8
- Forks: 18
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Spectra
=======
[![Build Status](http://img.shields.io/travis/avp/spectra.svg?style=flat)](https://travis-ci.org/avp/spectra)
[![Coverage Status](http://img.shields.io/coveralls/avp/spectra.svg?style=flat)](https://coveralls.io/r/avp/spectra?branch=master)
[![devDependency Status](http://img.shields.io/david/dev/avp/spectra.svg?style=flat)](https://david-dm.org/avp/spectra#info=devDependencies)
[![npm Version](http://img.shields.io/npm/v/spectra.svg?style=flat)](http://npmjs.org/package/spectra)
![GA Beacon](https://ga-beacon.appspot.com/UA-46742689-1/avp/spectra?pixel)A small Javascript library for quickly manipulating and converting colors.
Example
-------Spectra can be wrapped around many different types of objects to create a Spectra color that can be manipulated.
```javascript
var color = Spectra({r: 255, g: 25, b: 75});
color.red() // 255
```Motivation
----------The project was created to have a highly functional and lightweight way to deal with colors using Javascript, without any dependencies.
Installation
------------Simply download [spectra.min.js](https://github.com/avp/spectra/releases/) and include it before your source files.
### Bower
The bower package is at `spectrajs`.
bower install spectrajs
### Node
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.
Tests
-----There are [Jasmine](https://jasmine.github.io) 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.
### Coverage
Test coverage information can be generated by running `grunt karma`. Coverage information will be located in `test/coverage` after generation.
Building
--------To minify Spectra, run `grunt build`.
Contributing
------------View [CONTRIBUTING.md](https://github.com/avp/spectra/blob/master/CONTRIBUTING.md) for guidelines on how to contribute.