I have a huge list of images that I'm running through node-vibrant
. I'm noticing quite often the values of the getPalette()
object are null
, instead of an instance of Swatch
.
Is this a bug or is there some logic behind this? It certainly makes it difficult to programmatically associate some colours with an image.
looks like the vibrant palette (normal/light/dark) is returning sometimes null, whereas the muted is always available.
muted is also null sometimes
When using getRgb shit was broken about 50% of the time. Using getHex returned valid results always.
I eventually just had to use nested loops to see if certain color codes were returning null, and then see if the entire swatch itself was returning null otherwise the promise chain breaks. Probably not very efficient but now my colors load properly in the correct order every time.
node-vibrant
in projects that use npm
Can someone test against the update 3.1.1
to confirm a fix?
let me try and pingback if I found problems 👍
In fact @crutchcorn you can close this, I will comment again if I detect a weird behavior.
Thanks for your effort and time improving the project 🙂
That's probably for the best, thinking about it more. I have been using the code in a project and have confirmed a fix on my own project. Appreciate keeping an eye out for issues @Kikobeats , feel free to bump thread if issues in future like you mentioned :)