- Upgrade Expo SDK 52→53 (React 18→19, RN 0.76→0.79) - Remove deprecated packages (native-base, react-native-elements) - Migrate to @rneui/themed 5.0.0 + modular vector icons - Fix breaking changes: defaultProps, BackHandler, notifications, key props - Add Babel plugin for font scaling (replaces Text.defaultProps) - Configure expo-font for native font preloading - Add complete dark mode theme system (lib/theme/) - AppThemeProvider + useThemeColors hook - Light/dark/fixed color token definitions - Migrate ~60 files across all screens to use theme colors - Set userInterfaceStyle to "automatic" for system dark mode
205 lines
4.8 KiB
TypeScript
205 lines
4.8 KiB
TypeScript
/**
|
||
* アプリ全体のテーマカラー定義
|
||
*
|
||
* - `themeColors`: ライト/ダークで切り替わる色
|
||
* - `fixedColors`: テーマに関わらず固定の色(LED表示、路線色、列車種別色など)
|
||
*/
|
||
|
||
export type ThemeColorScheme = { [K in keyof typeof lightColors]: string };
|
||
|
||
// ─── テーマ依存カラー ──────────────────────────────────────────
|
||
|
||
export const lightColors = {
|
||
// 背景
|
||
background: "#ffffff",
|
||
backgroundSecondary: "#f8f8fc",
|
||
backgroundTertiary: "#f0f0f0",
|
||
backgroundInput: "#F4F4F4",
|
||
backgroundOverlay: "#00000010",
|
||
|
||
// サーフェス(カード、スクロール領域等)
|
||
surface: "#ffffff",
|
||
surfaceElevated: "#ffffff",
|
||
|
||
// テキスト
|
||
text: "#000000",
|
||
textPrimary: "#111111",
|
||
textSecondary: "#555555",
|
||
textTertiary: "#888888",
|
||
textQuaternary: "#aaaaaa",
|
||
textDisabled: "#cccccc",
|
||
textAccent: "#0099CC",
|
||
textLink: "#0000EE",
|
||
textStationName: "#005170",
|
||
textWarning: "#bf360c",
|
||
textError: "#c62828",
|
||
textCaution: "#856404",
|
||
|
||
// ボーダー
|
||
border: "#cccccc",
|
||
borderLight: "#f0f0f0",
|
||
borderSecondary: "#e4e4e4",
|
||
borderCard: "#ebebeb",
|
||
|
||
// アイコン
|
||
icon: "#000000",
|
||
iconSecondary: "#888888",
|
||
iconTertiary: "#cccccc",
|
||
iconAccent: "#0099CC",
|
||
|
||
// スイッチ・インタラクティブ
|
||
switchActive: "red",
|
||
|
||
// シャドウ
|
||
shadow: "#000000",
|
||
|
||
// 検索
|
||
searchBackground: "#F4F4F4",
|
||
searchBorder: "#F4F4F4",
|
||
suggestBackground: "#eeeeee",
|
||
|
||
// アクションシート
|
||
sheetBackground: "#ffffff",
|
||
sheetBorder: "#e8e8e8",
|
||
|
||
// ステータス
|
||
badgeBackground: "red",
|
||
badgeInfoBackground: "#00b8ff",
|
||
|
||
// ポジションボックス (FixedTrainBox等)
|
||
positionBoxPassed: "#6e6e6e77",
|
||
positionBoxCurrent: "#6e6e6eff",
|
||
|
||
// StationDiagram
|
||
diagramBackground: "#ffffff",
|
||
diagramSectionHeader: "#f0f0f0",
|
||
diagramBorder: "#cccccc",
|
||
diagramHighlight: "#8adeffff",
|
||
diagramInsertTarget: "#26d1baff",
|
||
diagramSortEnd: "#88c8e8",
|
||
} as const;
|
||
|
||
export const darkColors: ThemeColorScheme = {
|
||
// 背景
|
||
background: "#121212",
|
||
backgroundSecondary: "#1e1e2e",
|
||
backgroundTertiary: "#2a2a3a",
|
||
backgroundInput: "#2e2e3e",
|
||
backgroundOverlay: "#ffffff10",
|
||
|
||
// サーフェス
|
||
surface: "#1e1e2e",
|
||
surfaceElevated: "#252538",
|
||
|
||
// テキスト
|
||
text: "#e8e8e8",
|
||
textPrimary: "#f0f0f0",
|
||
textSecondary: "#b0b0b0",
|
||
textTertiary: "#888888",
|
||
textQuaternary: "#666666",
|
||
textDisabled: "#555555",
|
||
textAccent: "#33bbee",
|
||
textLink: "#6699ff",
|
||
textStationName: "#8ecfff",
|
||
textWarning: "#ff8a65",
|
||
textError: "#ef5350",
|
||
textCaution: "#ffd54f",
|
||
|
||
// ボーダー
|
||
border: "#444444",
|
||
borderLight: "#333333",
|
||
borderSecondary: "#3a3a4a",
|
||
borderCard: "#3a3a4a",
|
||
|
||
// アイコン
|
||
icon: "#e8e8e8",
|
||
iconSecondary: "#aaaaaa",
|
||
iconTertiary: "#666666",
|
||
iconAccent: "#33bbee",
|
||
|
||
// スイッチ・インタラクティブ
|
||
switchActive: "#ff6b6b",
|
||
|
||
// シャドウ
|
||
shadow: "#000000",
|
||
|
||
// 検索
|
||
searchBackground: "#2e2e3e",
|
||
searchBorder: "#3a3a4a",
|
||
suggestBackground: "#2a2a3a",
|
||
|
||
// アクションシート
|
||
sheetBackground: "#1e1e2e",
|
||
sheetBorder: "#3a3a4a",
|
||
|
||
// ステータス
|
||
badgeBackground: "#ff4444",
|
||
badgeInfoBackground: "#0099dd",
|
||
|
||
// ポジションボックス
|
||
positionBoxPassed: "#6e6e6e77",
|
||
positionBoxCurrent: "#6e6e6eff",
|
||
|
||
// StationDiagram
|
||
diagramBackground: "#1a1a2e",
|
||
diagramSectionHeader: "#2a2a3a",
|
||
diagramBorder: "#444444",
|
||
diagramHighlight: "#3a6a8aff",
|
||
diagramInsertTarget: "#1a8a7aff",
|
||
diagramSortEnd: "#4a6a7a",
|
||
} as const;
|
||
|
||
// ─── テーマ非依存カラー(固定) ─────────────────────────────────
|
||
|
||
export const fixedColors = {
|
||
// ブランド
|
||
primary: "#0099CC",
|
||
primaryDark: "#007aa3",
|
||
|
||
// LED発車標
|
||
ledBackground: "#432",
|
||
ledRowBackground: "#000000",
|
||
ledTextNormal: "white",
|
||
ledTextDelay: "#ffd16fff",
|
||
ledTextInfo: "green",
|
||
ledTextAlert: "red",
|
||
ledTextGold: "#d3a203",
|
||
ledTextCancelled: "#999999",
|
||
|
||
// ボタンカラー(FixedContentBottom 等)
|
||
buttonOrange: "#F89038",
|
||
buttonRed: "#EA4752",
|
||
buttonGreen: "#91C31F",
|
||
buttonPurple: "#AD7FA8",
|
||
buttonBrown: "#8F5902",
|
||
buttonGray: "#888A85",
|
||
buttonPink: "#ed86b5",
|
||
buttonBlue: "#729FCF",
|
||
buttonTeal: "#00796B",
|
||
buttonDeepOrange: "#E67E22",
|
||
buttonDeepPurple: "#9B59B6",
|
||
buttonDarkGreen: "#16A085",
|
||
buttonDarkBlue: "#2980B9",
|
||
buttonDarkRed: "#C0392B",
|
||
buttonDiscord: "rgb(88, 101, 242)",
|
||
|
||
// 通知LED
|
||
notificationLED: "#FF231F7C",
|
||
|
||
// 文字色 on Primary(常に白)
|
||
textOnPrimary: "white",
|
||
|
||
// 透明
|
||
transparent: "#00000000",
|
||
|
||
// エラー・警告
|
||
errorBorder: "#f44336",
|
||
|
||
// Felica
|
||
felicaMinus: "#00897B",
|
||
|
||
// アプリ内バナー
|
||
overlayBlue: "#007FCC88",
|
||
overlayWhite: "#ffffffc2",
|
||
} as const;
|