diff --git a/plugins/role-color-everywhere/src/lib/color.ts b/plugins/role-color-everywhere/src/lib/color.ts index 3ef9fa1..8f925eb 100644 --- a/plugins/role-color-everywhere/src/lib/color.ts +++ b/plugins/role-color-everywhere/src/lib/color.ts @@ -1,19 +1,10 @@ -import { find, findByStoreName } from "@vendetta/metro"; -import { semanticColors } from "@vendetta/ui"; +import { resolveSemanticColorSafe } from "@shared/lib/color"; export { interpolateColor } from "@shared/lib/color"; -export const ThemeStore = findByStoreName("ThemeStore"); - -export const resolveSemanticColor = - find((m: any) => m?.default?.internal?.resolveSemanticColor)?.default?.internal?.resolveSemanticColor ?? - find((m: any) => m?.meta?.resolveSemanticColor)?.meta?.resolveSemanticColor ?? - (() => undefined); - +// TEXT_NORMAL was a bare, un-guarded reference here (confirmed dead via Key Inspector - Discord +// renamed its whole semanticColors scheme, TEXT_NORMAL -> TEXT_DEFAULT among others), unlike every +// other token lookup in this repo which already goes through a multi-candidate fallback chain. export function defaultTextColor(): string | undefined { - try { - return resolveSemanticColor(ThemeStore?.theme, semanticColors.TEXT_NORMAL); - } catch { - return undefined; - } + return resolveSemanticColorSafe(["TEXT_NORMAL", "TEXT_DEFAULT"], "#dbdee1"); } diff --git a/plugins/server-drawer/src/utils/theme.ts b/plugins/server-drawer/src/utils/theme.ts index 20b3f82..6451e67 100644 --- a/plugins/server-drawer/src/utils/theme.ts +++ b/plugins/server-drawer/src/utils/theme.ts @@ -11,7 +11,10 @@ const getExpandedGuildFolderStore = lazy(() => rawFindByStoreName("ExpandedGuild export function useTheme() { const colors = getColorModule()?.colors; return { - text: colors?.TEXT_NORMAL ?? "#dbdee1", + // TEXT_NORMAL is confirmed dead via Key Inspector (Discord renamed its whole semanticColors + // scheme) - TEXT_DEFAULT is its current replacement, kept alongside the old name in case an + // older Discord build is still in use. + text: colors?.TEXT_NORMAL ?? colors?.TEXT_DEFAULT ?? "#dbdee1", folder: "#5865f2", hover: colors?.STATE_LAYER_PRESS ?? "rgba(255,255,255,0.06)", };