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.
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.