Open KevinPayravi opened 4 years ago
Use a library to determine the predominate color of the item's image, and return it.
Pro: Returned color will be the most accurate in terms of matching the image.
Cons: Not technically "Animal Crossing" data so may be out of scope; can be costly to calculate color averages, especially for users requesting items at once e.g. all villagers. May end up needing to store the calculated values somewhere, like a database.
Utilize the in-game colors attached to each item (e.g. critters and villagers in New Horizons each have two hidden colors associated with them, which come into play for gifting).
Pro: Data is already on the wiki, just needs to be stored in Cargo and then returned.
Cons: There are two colors, so Discord embeds will need to select one (the first one is usually the most true-to-image, but not 100% of the time; for example, the first color for the man-faced stink bug is black, not yellow as one might expect). This will work for New Horizons assets, but not necessarily assets from previous games.
I think utilizing the in-game colors is the way to go for this one, as averaging the images would be outside the scope of the API, IMO. Plus, from personal experience, averaging the color of an image for something like that can end up with gross looking colors that aren't as appealing, if the image happens to have a lot of variation in its color.
As for older games, I think the best solutions are
Users have requested colors for critters and villagers (and any future items), primarily to decorate Discord embeds with. There are a couple solutions here: