Skip to content

Commit 83b5321

Browse files
authored
Merge pull request #6092 from cmppoon/fix-default-predefine-color-palette
fix: default color not selected in appearance color palette
2 parents 34fe0e1 + b2b0c64 commit 83b5321

File tree

3 files changed

+40
-30
lines changed

3 files changed

+40
-30
lines changed

web-app/src/containers/ColorPickerAppBgColor.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@ import {
88
DropdownMenuTrigger,
99
} from '@/components/ui/dropdown-menu'
1010
import { useTranslation } from '@/i18n/react-i18next-compat'
11+
import { useTheme } from '@/hooks/useTheme'
1112

1213
export function ColorPickerAppBgColor() {
1314
const { appBgColor, setAppBgColor } = useAppearance()
15+
const { isDark } = useTheme()
1416
const { t } = useTranslation()
1517

1618
const predefineAppBgColor: RgbaColor[] = [
17-
{
18-
r: 20,
19-
g: 20,
20-
b: 20,
21-
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
22-
},
23-
{
24-
r: 250,
25-
g: 250,
26-
b: 250,
27-
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
28-
},
19+
isDark
20+
? {
21+
r: 25,
22+
g: 25,
23+
b: 25,
24+
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
25+
}
26+
: {
27+
r: 255,
28+
g: 255,
29+
b: 255,
30+
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
31+
},
2932
{
3033
r: 70,
3134
g: 79,

web-app/src/containers/ColorPickerAppDestructiveColor.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ import {
77
DropdownMenuContent,
88
DropdownMenuTrigger,
99
} from '@/components/ui/dropdown-menu'
10+
import { useTheme } from '@/hooks/useTheme'
1011

1112
export function ColorPickerAppDestructiveColor() {
1213
const { appDestructiveBgColor, setAppDestructiveBgColor } = useAppearance()
14+
const { isDark } = useTheme()
1315

1416
const predefineAppDestructiveBgColor: RgbaColor[] = [
15-
{
16-
r: 220,
17-
g: 45,
18-
b: 45,
19-
a: 1,
20-
},
17+
isDark
18+
? { r: 144, g: 60, b: 60, a: 1 }
19+
: {
20+
r: 217,
21+
g: 95,
22+
b: 95,
23+
a: 1,
24+
},
2125
{
2226
r: 220,
2327
g: 100,

web-app/src/containers/ColorPickerAppMainView.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,26 @@ import {
77
DropdownMenuContent,
88
DropdownMenuTrigger,
99
} from '@/components/ui/dropdown-menu'
10+
import { useTheme } from '@/hooks/useTheme'
1011

1112
export function ColorPickerAppMainView() {
1213
const { appMainViewBgColor, setAppMainViewBgColor } = useAppearance()
14+
const { isDark } = useTheme()
1315

1416
const predefineAppMainViewBgColor: RgbaColor[] = [
15-
{
16-
r: 251,
17-
g: 251,
18-
b: 251,
19-
a: 1,
20-
},
21-
{
22-
r: 24,
23-
g: 24,
24-
b: 24,
25-
a: 1,
26-
},
17+
isDark
18+
? {
19+
r: 25,
20+
g: 25,
21+
b: 25,
22+
a: 1,
23+
}
24+
: {
25+
r: 255,
26+
g: 255,
27+
b: 255,
28+
a: 1,
29+
},
2730
]
2831

2932
return (

0 commit comments

Comments
 (0)