Files
pi-mobile/apps/mobile/lib/theme.ts
T
2026-07-09 12:07:57 -05:00

47 lines
1.2 KiB
TypeScript

import { Platform } from "react-native";
export const colors = {
background: "#0a0a0a",
surface: "#171717",
surfaceDeep: "#101010",
border: "#262626",
borderSubtle: "#1c1c1c",
text: "#f5f5f5",
textSecondary: "#a3a3a3",
textMuted: "#737373",
accent: "#93c5fd",
success: "#4ade80",
warning: "#fbbf24",
error: "#f87171",
errorMuted: "#fca5a5",
errorBorder: "#7f1d1d",
userBubbleBg: "#f5f5f5",
userBubbleText: "#0a0a0a",
senderUser: "#4ade80",
senderAgent: "#93c5fd",
railUser: "rgba(74, 222, 128, 0.35)",
railAgent: "rgba(147, 197, 253, 0.25)",
} as const;
export const monoFont = Platform.select({
ios: "Menlo",
default: "monospace",
});
export const projectTints = [
{ bg: "rgba(147, 197, 253, 0.14)", fg: "#93c5fd" },
{ bg: "rgba(74, 222, 128, 0.14)", fg: "#4ade80" },
{ bg: "rgba(251, 191, 36, 0.14)", fg: "#fbbf24" },
{ bg: "rgba(196, 181, 253, 0.14)", fg: "#c4b5fd" },
{ bg: "rgba(103, 232, 249, 0.14)", fg: "#67e8f9" },
{ bg: "rgba(253, 164, 175, 0.14)", fg: "#fda4af" },
] as const;
export function tintFor(name: string) {
let hash = 0;
for (let i = 0; i < name.length; i += 1) {
hash = (hash * 31 + name.charCodeAt(i)) | 0;
}
return projectTints[Math.abs(hash) % projectTints.length];
}