Open SeBsZ opened 8 years ago
Possible maybe, but I don't really know how I can return these percentages without breaking the current API... Any ideas ?
I need this too. a relative percentage between 0 - 100 or 0 - 1 for each color returned. This way one could query for images with at least xx% of a particular color...
Possible maybe, but I don't really know how I can return these percentages without breaking the current API... Any ideas ?
How about a new option for $outputFormat
such as 'detailed'
?
ColorThief::getColor
could then return something like:
[
'color' => $colorInstance, // ColorThief\Color instance – can get preferred colour format from this
'percentage' => 0.2, // colour dominance
]
And ColorThief::getPalette
would return an array of these arrays..?
Would it be possible to get some sort of dominance percentage for each color returned in the palette, so I can choose the second most dominant color for example?