JSPM

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

Color manipulation library

Package Exports

  • xolor

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

Readme

xcolor

Description

An extensive color manipulation library.

Calculating Colors

// Calculate a grey level color value
xolor('#c00').greyfilter()

// Calculate a gradient color between #fc0 and #f00 23% of the way through the gradient
xolor('#fc0').gradientlevel('#f00', .23)

// Calculate the visible color when lightgrey is overlayed on top of #f00 with an opacity of 69%.
xolor('#f00').opacity('lightgrey', 0.69)

Colorizing Text

var element = document.getElementById('foo')
xolor.colorize(element, "burntsienna", "blue", function() {
   // Colors each character a random color between "burntsienna" and "blue"
   return Math.random()
})

Further examples

This library was ported from the jquery xcolor plugin, and has all the non-jQuery related functionality that library had. Some great documentation for that library that will help understand the methods in this library, see the code examples and demonstrations here: http://www.xarg.org/project/jquery-color-plugin-xcolor/

License

Dual licensed under the MIT or GPL Version 2 licenses.