JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 311
  • Score
    100M100P100Q104194F
  • License MIT

The Spectrum Colorpicker with Vanilla JS

Package Exports

  • spectrum-vanilla
  • spectrum-vanilla/dist/spectrum.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (spectrum-vanilla) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Spectrum Vanilla

alt text

Created by @bgrins and @seballot, modified by @asika32764

Basic Usage

Head over to the Documentation Website for more information.

<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-colorpicker2

Using spectrum with a CDN

<script src="https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.css">

Download

Download latest version

Building Spectrum Locally

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/seballot/spectrum/tree/master/src/i18n