Browse Source

替换`24,144,255`这样的主题色

huangzheng 5 years ago
parent
commit
db7fc91510
2 changed files with 4 additions and 2 deletions
  1. 2 1
      config/plugin.config.js
  2. 2 1
      src/components/SettingDrawer/themeColor.js

+ 2 - 1
config/plugin.config.js

@@ -7,7 +7,8 @@ const getAntdSerials = (color) => {
     return ThemeColorReplacer.varyColor.lighten(color, i / 10)
   })
   const colorPalettes = generate(color)
-  return lightens.concat(colorPalettes)
+  const rgb = ThemeColorReplacer.varyColor.toNum3(color.replace('#', '')).join(',')
+  return lightens.concat(colorPalettes).concat(rgb)
 }
 
 const themePluginOption = {

+ 2 - 1
src/components/SettingDrawer/themeColor.js

@@ -9,7 +9,8 @@ export default {
     })
     // colorPalette变换得到颜色值
     const colorPalettes = generate(color)
-    return lightens.concat(colorPalettes)
+    const rgb = client.varyColor.toNum3(color.replace('#', '')).join(',')
+    return lightens.concat(colorPalettes).concat(rgb)
   },
   changeColor (newColor) {
     var options = {