It'd be useful if this lib supported a transition function that was separate from the DOM. The current API does two things for you:
transitions the colors
updates the DOM
It's convenient that it does both, but tying them together also limits the portability of the lib, as it prevents you from transitioning colors outside of the DOM transforms that this lib supports.
where onUpdate receives the current color as its first arg. This would allow the library to be used in more contexts, such as headless environments (i.e.; Node), as well as additional DOM contexts, such as canvas.
It'd be useful if this lib supported a transition function that was separate from the DOM. The current API does two things for you:
It's convenient that it does both, but tying them together also limits the portability of the lib, as it prevents you from transitioning colors outside of the DOM transforms that this lib supports.
Consider a function like:
where
onUpdate
receives the current color as its first arg. This would allow the library to be used in more contexts, such as headless environments (i.e.; Node), as well as additional DOM contexts, such as canvas.