aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/appearance/test_wallcolors.js
AgeCommit message (Collapse)AuthorFilesLines
15 hoursfeat(wallpapers): filter by colour, one folder open at a timeDanilo M.1-0/+47
A row of colour circles under the mock screens filters the thumbnails to the wallpapers a colour dominates; a second click clears it, and folders left empty drop out. magick quantizes a 64 px copy of each image to six colours, in parallel, and WallColors.js files every colour under a hue bucket, or dark or light when it has little saturation. Each image matches one bucket only: the largest colour bucket when it covers a quarter of the image, else the larger of dark and light. Matching any bucket over a fifth mixed a red sunset in with blue skies. Saturation is HSV's, since HSL reads a pale lavender as strongly coloured. The raw colours are cached by path in ~/.cache/keystone/wallcolors.tsv, so only new files are analysed; the first run over 843 images took about 20 seconds. The circles use fixed colours rather than the theme's: they name hue buckets that do not move with the scheme, and the live scheme reused one colour under several names, drawing three pairs of twin circles. Opening a folder now folds whichever was open. A filter that empties the open folder folds it for real and opens the first folder with matches; merely hidden, it came back beside the next one opened once the filter was cleared. Run: node desktop/modules/appearance/test_wallcolors.js Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>