mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
This commit is contained in:
parent
d677fc99de
commit
5f82bdeb67
@ -17,9 +17,9 @@ const config = computed(() => {
|
||||
return rgb
|
||||
}
|
||||
if (light || dark) {
|
||||
return { light, dark }
|
||||
return cleanObject({ light, dark })
|
||||
}
|
||||
return { r, g, b }
|
||||
return cleanObject({ r, g, b })
|
||||
})
|
||||
|
||||
const lightTint = {
|
||||
@ -34,6 +34,14 @@ const darkTint = {
|
||||
b: { value: 32, offset: 36 },
|
||||
}
|
||||
|
||||
function cleanObject(obj: any) {
|
||||
for (const key in obj) {
|
||||
if (obj[key] === undefined)
|
||||
delete obj[key]
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
function toPlate(plate: number | string) {
|
||||
return typeof plate === 'number' || Number(plate) === Number.parseInt(plate)
|
||||
? [plate, plate, plate].map(n => Number(n))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user