-
Notifications
You must be signed in to change notification settings - Fork 52
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
Comments
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. |
👍 |
So, this will be possible in version colorify.js v1.2 :) If you have any other questions, ideas or feedback, just tell me :) |
As you can see, things are going pretty good :) 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) } |
much powerful! 😁 |
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:
Now I can select the container that I want to apply the style. If I pass a container with more than one image:
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.
The text was updated successfully, but these errors were encountered: