diff --git a/ui/src/utils/theme.ts b/ui/src/utils/theme.ts index b296cdf3e..96a885938 100644 --- a/ui/src/utils/theme.ts +++ b/ui/src/utils/theme.ts @@ -46,3 +46,13 @@ export const defaultPlatformSetting = { showProject: true, projectUrl: 'https://github.com/1Panel-dev/MaxKB' } + +export function hexToRgba(hex: string, alpha: number) { + // 将16进制颜色值的两个字符一起转换成十进制 + const r = parseInt(hex.slice(1, 3), 16) + const g = parseInt(hex.slice(3, 5), 16) + const b = parseInt(hex.slice(5, 7), 16) + + // 返回RGBA格式的字符串 + return `rgba(${r}, ${g}, ${b}, ${alpha})` +} diff --git a/ui/src/views/chat/embed/index.vue b/ui/src/views/chat/embed/index.vue index 7d2e56d33..5d67b6f81 100644 --- a/ui/src/views/chat/embed/index.vue +++ b/ui/src/views/chat/embed/index.vue @@ -2,7 +2,10 @@
@@ -73,6 +76,7 @@