Skip to content

Commit

Permalink
fix: color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
eatgrass committed Nov 13, 2023
1 parent 81971c5 commit 06e7783
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ export const rerender = (settings: HighlightSettings) => {
| 'idiomatic'
)[] = ['basic', 'intermediate', 'advanced', 'specialized', 'idiomatic']

console.log(settings)

for (let i = 0; i < levels.length; i++) {
// set background color
document.documentElement.style.setProperty(
`--vocab-hl-${levels[i+1]}`,
`--vocab-hl-${levels[i]}`,
settings[levels[i]].bg,
)

Expand Down
3 changes: 2 additions & 1 deletion src/SettingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ export default class HighlistSettingsTab extends PluginSettingTab {

picker.onChange(() => {
const { r, g, b } = picker.getValueRgb()
let s = getSettings()
updateSettings({
[category]: { ...[category], bg: `${r}, ${g}, ${b}` },
[category]: { ...s[category], bg: `${r}, ${g}, ${b}` },
})
this.plugin.saveSettings()
})
Expand Down

0 comments on commit 06e7783

Please sign in to comment.