JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q42522F
  • License ISC

A jQuery plugin for automatic content colorization.

Package Exports

  • jquery.chameleon.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 (jquery.chameleon.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Chameleon.js

A jQuery plugin for automatic content colorization.

Features

  1. Colorize the content with image;
  2. Get colors from an image;
  3. Sort colors by various parameters (hue, saturation, value, chroma, alpha);
  4. Some color manipulations (format, luminance, transparency, readable);
  5. Wrap the color in the jQuery element.

Install

Download directly from GitHub or install via npm/Bower.

Include jQuery and the plugin:

<script src="path/to/jquery.js"></script>
<script src="path/to/jquery.chameleon.js"></script>

Or add Chameleon.js to jQuery:

import $ from 'jquery';
import addChameleonJsToJquery from 'jquery.chameleon.js/addChameleonJsToJquery';

addChameleonJsToJquery($);

Debug

If you need debug, include it:

<script src="path/to/chameleonDebug.js"></script>

With addChameleonJsToJquery($) debug included automatically.

Enable debug:

$(document).ready(function() {
    $('.chmln').chameleon({
        debug: true
    });
});

Modes

If you need colorization modes, include it:

<script src="path/to/colorization/mode.js"></script>

With addChameleonJsToJquery($) modes included automatically.

Use modes:

$(document).ready(function() {
    $('.chmln').chameleon({
        colorize_mode: {
            name: "blur",
            config: {}
          }
    });
});

Styles

If you need styles for color elements, include it:

<link rel="stylesheet" href="path/to/chmln__colors.css">

Or import:

import 'jquery.chameleon.js/css/chmln__colors.css';

Use

Run the plugin:

$(document).ready(function() {
    $('.chmln').chameleon();
});

For more information and examples check the demo page.