fix: default color not selected in appearance color palette

This commit is contained in:
Chaiyapruek Muangsiri 2025-08-08 09:00:44 +08:00
parent 469d787888
commit b2b0c64c48
3 changed files with 40 additions and 30 deletions

View File

@ -8,22 +8,25 @@ import {
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu' } from '@/components/ui/dropdown-menu'
import { useTranslation } from '@/i18n/react-i18next-compat' import { useTranslation } from '@/i18n/react-i18next-compat'
import { useTheme } from '@/hooks/useTheme'
export function ColorPickerAppBgColor() { export function ColorPickerAppBgColor() {
const { appBgColor, setAppBgColor } = useAppearance() const { appBgColor, setAppBgColor } = useAppearance()
const { isDark } = useTheme()
const { t } = useTranslation() const { t } = useTranslation()
const predefineAppBgColor: RgbaColor[] = [ const predefineAppBgColor: RgbaColor[] = [
{ isDark
r: 20, ? {
g: 20, r: 25,
b: 20, g: 25,
b: 25,
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4, a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
}, }
{ : {
r: 250, r: 255,
g: 250, g: 255,
b: 250, b: 255,
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4, a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
}, },
{ {

View File

@ -7,15 +7,19 @@ import {
DropdownMenuContent, DropdownMenuContent,
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu' } from '@/components/ui/dropdown-menu'
import { useTheme } from '@/hooks/useTheme'
export function ColorPickerAppDestructiveColor() { export function ColorPickerAppDestructiveColor() {
const { appDestructiveBgColor, setAppDestructiveBgColor } = useAppearance() const { appDestructiveBgColor, setAppDestructiveBgColor } = useAppearance()
const { isDark } = useTheme()
const predefineAppDestructiveBgColor: RgbaColor[] = [ const predefineAppDestructiveBgColor: RgbaColor[] = [
{ isDark
r: 220, ? { r: 144, g: 60, b: 60, a: 1 }
g: 45, : {
b: 45, r: 217,
g: 95,
b: 95,
a: 1, a: 1,
}, },
{ {

View File

@ -7,21 +7,24 @@ import {
DropdownMenuContent, DropdownMenuContent,
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu' } from '@/components/ui/dropdown-menu'
import { useTheme } from '@/hooks/useTheme'
export function ColorPickerAppMainView() { export function ColorPickerAppMainView() {
const { appMainViewBgColor, setAppMainViewBgColor } = useAppearance() const { appMainViewBgColor, setAppMainViewBgColor } = useAppearance()
const { isDark } = useTheme()
const predefineAppMainViewBgColor: RgbaColor[] = [ const predefineAppMainViewBgColor: RgbaColor[] = [
{ isDark
r: 251, ? {
g: 251, r: 25,
b: 251, g: 25,
b: 25,
a: 1, a: 1,
}, }
{ : {
r: 24, r: 255,
g: 24, g: 255,
b: 24, b: 255,
a: 1, a: 1,
}, },
] ]