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

add a flag to ouptut instead of modify #18

Open
Kikobeats opened this issue Dec 21, 2015 · 5 comments
Open

add a flag to ouptut instead of modify #18

Kikobeats opened this issue Dec 21, 2015 · 5 comments

Comments

@Kikobeats
Copy link

The case of use of this library for me is get the gradient style to apply instead of specify what element modify.

I think that could be much clear to use and accord with the definition of 'simple'. For example:

var gradient = colorify({container: #myImage})
// => { 'background-image': 'linear-gradient(to right bottom, rgb(0, 0, 0), rgb(0, 0, 0))'}

Now I can select the container that I want to apply the style. If I pass a container with more than one image:

var gradient = colorify({container: #myImages})
// => { image1: 'background-image': 'linear-gradient(to right bottom, rgb(0, 0, 0), rgb(0, 0, 0))',
//      image2: 'background-image': 'linear-gradient(to right bottom, rgb(0, 0, 0), rgb(0, 0, 0))',
//      image3: 'background-image': 'linear-gradient(to right bottom, rgb(0, 0, 0), rgb(0, 0, 0))' }

Just an example, but I think If the library follow this approach could be more flexible.

As simple idea, separate the process to get the color from the process of apply the color.

@LukyVj
Copy link
Owner

LukyVj commented Dec 22, 2015

Hi again @Kikobeats

I understand your point, but what the use of this library is to you, is probably different for other people.

Even if it's a good idea and a better syntax, I think on a next release, I would use such syntax, to keep things clear :

 var gradient = colorify.gradient({container: #myImage}),
        color = colorify.color({container: #myImage});

// and so on .. 

You gave me a few ideas, and yes, I want it more flexible at the end.
Thanks for your participation ! Looking forward to show you the next version ! :)

@Kikobeats
Copy link
Author

👍

@LukyVj
Copy link
Owner

LukyVj commented Jan 8, 2016

So, this will be possible in version colorify.js v1.2 :)
I'm currently building it.

If you have any other questions, ideas or feedback, just tell me :)

@LukyVj
Copy link
Owner

LukyVj commented Jan 8, 2016

As you can see, things are going pretty good :)
So far, I've added those possibilities:

Colorify.infos({container: 'containerID'}) // => object { image: image_url, type: image_type, background color / image: rgb(r, g, b) / rgb(r, g, b), rgb(r, g, b)  }
Colorify.getBackground({container: 'containerID'}) // => object { background color / image: rgb(r, g, b) / rgb(r, g, b), rgb(r, g, b) }
Colorify.color({container: 'containerID', accuracy: '100', invert: false}) // => object { color : rgb(r, g, b) }
Colorify.gradient({container: 'containerID', accuracy: '100', invert: false}) // => object { image: rgb(r, g, b), rgb(r, g, b) }
Colorify.invert({container: 'containerID'}) // => object { background color / image: rgb(r, g, b) / rgb(r, g, b), rgb(r, g, b) }

@Kikobeats
Copy link
Author

much powerful! 😁

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

No branches or pull requests

2 participants