Skip to content

Instantly share code, notes, and snippets.

@mattdesl
Created September 1, 2014 16:27
Show Gist options
  • Save mattdesl/ebbcd9b3967dae275557 to your computer and use it in GitHub Desktop.
Save mattdesl/ebbcd9b3967dae275557 to your computer and use it in GitHub Desktop.
var rgb2hsl = require('./rgb2hsl')
var palette = require('./palette')(options)
//e.g.
console.log( rgb2hsl([255,0,255]) )
function Palette(options) {
//this line allows somebody to just require('palette')(opts) instead of
//always needing to call new Palette(opts)
//it's optional, but I find it leads to cleaner code
if (!(this instanceof Palette)) return new Palette(options)
options = options||{}
... do something here ...
}
module.exports = Palette
module.exports = function rgb2hsl(rgb) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment