Socket
Socket
Sign inDemoInstall

spectra

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spectra

Javascript color manipulation library.


Version published
Maintainers
1
Created

Readme

Source

Spectra

Build Status Coverage Status Dependency Status NPM version Stories in Ready GA Beacon

A small Javascript library for quickly manipulating and converting colors.

NPM

Example

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

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 and include it before your source files.

Bower

The bower package is at spectra-color.

bower install spectra-color

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://aakpat6.github.io/spectra for reference on how to use Spectra.

Tests

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.

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

To develop for this project, you should first install Node.js, which includes the Node Package Manager. Running npm install will install any necessary packages.

You should also install Grunt by running npm install -g grunt-cli.

Take care to maintain the existing code style. Make sure to add tests in the test/tester.js file for any new features that you add. Make sure to run grunt test before submitting.

Any code that doesn't pass the build will not be accepted.

Files should all have a newline at the end of them, for consistency.

FAQs

Last updated on 05 Feb 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc