Node-vibrant: Inconsistent values from getPalette()

Created on 15 Mar 2017  ·  9Comments  ·  Source: Vibrant-Colors/node-vibrant

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.

awaiting feedback bug

All 9 comments

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.

78 fixes this. There's also instructions in that PR that explains how you can use a fixed version of 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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amirping picture amirping  ·  6Comments

glomotion picture glomotion  ·  5Comments

eggers picture eggers  ·  3Comments

inbarshani picture inbarshani  ·  4Comments

nitriques picture nitriques  ·  12Comments