1.1.0 • Published 11 years ago
chloroform v1.1.0
Chloroform
Feeling colorless? Chloroform
is here to help.
Usage
Does this rag smell funny to you?
Add chloroform.js
to your project.
Pass an image url and a callback that will be called when the processing is done.
The resulting colors will be passed to the callback.
Each color is a string containing comma-separated RGB values:
"255,255,255"
for white"0,0,0"
for black"255,0,0"
for red- etc.
background
is the background color of the image.
contrast
will be white for dark backgrounds and black for light backgrounds.
Chloroform.analyze(image_url, function(colors) {
colors.background;
colors.contrast;
colors[0];
colors[1];
colors[2];
});
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request