JSPM

chameleon-js

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q18473F

Javascript Library to handle Color calculations

Package Exports

  • 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 (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

h1. Chameleon Javascript Color Manipulation Library

A Simple yet powerful color manipulation lib written in javascript based on the color theory http://www.tigercolor.com/color-lab/color-theory/color-theory-intro.htm

h3. Dependencies

Neon Javascript Class DSL http://github.com/azendal/neon

h3. Browser support

All Major Browsers

h3. Examples


  // Make an instance of Chameleon
  var color = new Chameleon('#00FF00');

  color.getHue(); // returns 120

  color.setSaturation(20); // modifies the saturation value

  color.rotateBy(15); // shift the hue value the given degrees

  // Test if a Color is Legible over some other Background Color
  var text       = new Chameleon('#00FF00');
  var background = new Chameleon('#FF0000');

  text.isLegible(background); // returns true

  text.getLegibles(background) // returns an array of "STRING" Objects with modified saturation and values that are readable on the given background color

h3. Help and Contact

You are very welcome to contribute. Just fork the git repository and create a new issue, send a pull request or contact me personally.

h3. Contributors

Sergio de la Garza (Lead Developer) -sergio.delagarza [at] gmail -@sgarza (Twitter)

Fernando Trasviña (Core Member Lead) -trasvina [at] gmail -@azendal (Twitter)