Fix #453 (Fuzzel) Predefined colorscheme templating was not supporting ".hex_stripped"

This commit is contained in:
ItsLemmy
2025-10-14 20:30:45 -04:00
parent 38f698747b
commit 8ff7086321
+3 -1
View File
@@ -273,11 +273,13 @@ Singleton {
}
function replaceColorsInFile(filePath, colors) {
// This handle both ".hex" and ".hex_stripped" the EXACT same way. Our predefined color schemes are
// always RRGGBB without alpha so this is fine and keeps compatibility with matugen.
let script = ""
Object.keys(colors).forEach(colorKey => {
const colorValue = colors[colorKey].default.hex
const escapedColor = colorValue.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
script += `sed -i 's/{{colors\\.${colorKey}\\.default\\.hex}}/${escapedColor}/g' '${filePath}'\n`
script += `sed -i 's/{{colors\\.${colorKey}\\.default\\.hex\\(_stripped\\)\\?}}/${escapedColor}/g' '${filePath}'\n`
})
return script
}