mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-13 13:23:42 +08:00
refactor(hooks): refactor @sa/color-palette
This commit is contained in:
@@ -81,14 +81,12 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
||||
*/
|
||||
function updateThemeColors(key: App.Theme.ThemeColorKey, color: string) {
|
||||
// get a color palette by provided color and color name, and use the suitable color
|
||||
const colorPalette = getColorPalette(color, key);
|
||||
|
||||
const mainColor = colorPalette.main.hexcode;
|
||||
const { main } = getColorPalette(color);
|
||||
|
||||
if (key === 'primary') {
|
||||
settings.value.themeColor = mainColor;
|
||||
settings.value.themeColor = main.hex;
|
||||
} else {
|
||||
settings.value.otherColor[key] = mainColor;
|
||||
settings.value.otherColor[key] = main.hex;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user