Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: ability to get just colors #14

Closed
hellsan631 opened this issue Aug 26, 2016 · 4 comments
Closed

Request: ability to get just colors #14

hellsan631 opened this issue Aug 26, 2016 · 4 comments

Comments

@hellsan631
Copy link

Really like the concept, what would you think about having a method that stops before rendering out the wrapper, and just gets the 2 dominant colours in the image?

@DarrylD
Copy link

DarrylD commented Aug 27, 2016

I too think it would be nice to have access to the colors. I want to use them outside of just the wrapper. Maybe id each element and set a global object for them?

@DarrylD
Copy link

DarrylD commented Aug 27, 2016

@hellsan631 i did notice the colors are available in localstorage https://github.com/benhowdle89/grade/blob/master/src/index.js#L113

@benhowdle89
Copy link
Owner

Good idea.

My proposed usage:

Grade(imageContainers, imageSelector, function(gradients){
    // structure of `gradients`
    [{
        element: <Node>,
        data: // gradient data
    }]
})

You could then loop through gradients and get access to each image container that you passed in, along with the corresponding gradient data. Sound good?

@benhowdle89
Copy link
Owner

benhowdle89 commented Aug 29, 2016

Done, check it out:

ada9063

The README has been updated for full usage details...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants