1.0.0 • Published 10 years ago

stylesheet-colors v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

stylesheet-colors experimental

Get a unique list of all the colors used in your current page's stylesheets.

Usage

NPM

colors = getColors(stylesheet(s))

Returns an array of colors found in your stylesheets, e.g.:

[
  'rgb(25, 25, 25)',
  'rgba(35, 25, 25, 0.2)'
]

Optionally you can pass in your own selection of stylesheets from document.styleSheets or an individual one – by default all of the current page's stylesheets will be used.

License

MIT. See LICENSE.md for details.