avp / spectra

A Javascript color library. Quickly manipulate and convert colors.
avp.github.io/spectra
MIT License
237 stars 18 forks source link

Blend modes #13

Open benjamminf opened 10 years ago

benjamminf commented 10 years ago

Perhaps an ability to use blending modes? Usage could be something like:

var color1 = Spectra(...);
var color2 = Spectra(...);
var blended = color1.blend(color2, mode);

Where mode is the name of the blend mode as a string.

avp commented 10 years ago

Looks good - do you want to implement these?

benjamminf commented 10 years ago

Now that I think about it, it might make more sense to specify each blend mode as it's own method.

color.dissolve(...);
color.multiply(...);
color.screen(...);
...

But I'll give it a shot.

avp commented 10 years ago

That sounds good. These are kind of like variations on mix so they really should be different functions.

benjamminf commented 10 years ago

Yeah exactly what I was thinking.