Skip to content

Commit 4407f3b

Browse files
authored
fix: parse saturation param from theme URL config (#258)
1 parent 80ea5c1 commit 4407f3b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

docs/ui/src/js/params.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ function paramSetup() {
114114
contrastSliderVal.innerHTML = `${round(contrast * 100)}%`;
115115
_theme.contrast = contrast;
116116

117+
// handle saturation parameter
118+
let saturation;
119+
if (!config.saturation && config.saturation !== 0) {
120+
saturation = 100;
121+
} else {
122+
saturation = config.saturation;
123+
}
124+
let saturationSlider = document.getElementById('themeSaturationSlider');
125+
let saturationSliderVal = document.getElementById('themeSaturationValue');
126+
saturationSlider.value = saturation;
127+
saturationSliderVal.innerHTML = `${round(saturation)}%`;
128+
_theme.saturation = saturation;
129+
117130
// generate the options for the base scale,
118131
// then select the option defined in parameters
119132
baseScaleOptions();

0 commit comments

Comments
 (0)