Request: is it possible for the library to offer sorting the colours light to dark?
u01jmg3 opened this issue · comments
Jonathan Goode commented
- Is it possible for the library to offer sorting the colours light to dark?
Mathieu commented
Have you tried using ksort
on getIterator()
return?
Jonathan Goode commented
Sorry for the slow reply.
How would I use that with this?
$image_path = 'cv.png';
$palette = Palette::fromFilename($image_path);
$colours = $palette->getMostUsedColors(6);
Mathieu commented
Convert colors into HSL color space and then you'll be able to sort them by L.
Such a functionality is outside the scope of this lib.