D28134: Add ColorUtils
Marco Martin
noreply at phabricator.kde.org
Thu Mar 19 09:05:18 GMT 2020
mart added a comment.
First of all.. I love the idea! :)
I wanted something like that, tough i had a slightly different approach.. i find the global average color usually producing a kinda washed down color (from what happens in the plasma mobile app startup screen)
For another project i needed something along the lines, and ended up using a variant of the k-means clustering technique, so you have averages of the colors grouped in clusters by frequency which can generate interesting palettes to play with (then is trivial to add a global average if really needed).
https://towardsdatascience.com/extracting-colours-from-an-image-using-k-means-clustering-9616348712be
the first implementation is there (i want a way better api for it to be integrated in kirigami tough)
https://invent.kde.org/kde/plasma-bigscreen/-/blob/master/components/imagepalette.h
INLINE COMMENTS
> colorutils.cpp:26
> + connect(response.data(), &QQuickItemGrabResult::ready, &loop, &QEventLoop::quit);
> + loop.exec();
> +
sync calls should be avoided whenever possible
REPOSITORY
R169 Kirigami
REVISION DETAIL
https://phabricator.kde.org/D28134
To: cblack, #plasma, mart
Cc: plasma-devel, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, ahiemstra, davidedmundson, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200319/aebbb080/attachment.html>
More information about the Plasma-devel
mailing list