🌈️ apply a wallpaper based on the weather outside
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: it's LCH not HCL

Angel Wang (Jun 21, 2026, 12:51 PM -0600) e14c9ae5 3eb93155

+6 -6
+1 -1
analyze/analysis.ts
··· 72 72 const chroma = Number(dominantColour[1]) 73 73 const hue = Number(dominantColour[2]) 74 74 75 - analysisOutput.files.push({ path: path, oklch: [hue, chroma, lightness] }) 75 + analysisOutput.files.push({ path: path, oklch: [lightness, chroma, hue] }) 76 76 77 77 // flush every time we finish analyzing a file, because it just takes so long 78 78 fs.writeFile(outputPath, JSON.stringify(analysisOutput, null, 4), (err: Error) => {
+4 -2
apply/application.ts
··· 82 82 chromaValue: number, 83 83 lightnessValue: number, 84 84 ) { 85 - const targetColour = [hueValue, chromaValue, lightnessValue] 86 - let closestColour = { path: "", oklch: [-1, -1, -1] } 85 + const targetColour = [lightnessValue, chromaValue, hueValue] 86 + let closestColour = imagesData.files[0] 87 87 88 88 for (const file of imagesData.files) { 89 89 if ( ··· 94 94 closestColour = file 95 95 } 96 96 } 97 + console.info(`Found target image ${closestColour.path} with colour oklch(${closestColour.oklch[0]} ${closestColour.oklch[1]} ${closestColour.oklch[2]})!`) 98 + 97 99 return closestColour 98 100 }
+1 -3
apply/index.ts
··· 53 53 config.lightnessRange.end, 54 54 ) 55 55 56 - console.info(`Got hue value ${hueValue}°!`) 57 - console.info(`Got chroma value ${chromaValue}%!`) 58 - console.info(`Got lightness value ${lightnessValue}%!`) 56 + console.info(`Calculated target colour oklch(${lightnessValue} ${chromaValue} ${hueValue})!`) 59 57 60 58 console.debug(`Trying to open cache file ${pathToCache}...`) 61 59 const cacheFile = await fs.promises.readFile(`${pathToCache}`, {