Open History to see the last commit
1import type { UsageProviderKind } from "@t3tools/contracts";
2import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
3
4/**
5 * Series and table order. The chart stacks providers from the bottom in this
6 * order, so it also fixes which band sits on top of the bars.
7 */
8export const PROVIDER_ORDER: readonly UsageProviderKind[] = [
9 "codex",
10 "claude",
11 "grok",
12 "cursor",
13 "opencode",
14 "antigravity",
15];
16
17export const PROVIDER_LABEL: Record<UsageProviderKind, string> = {
18 claude: "Claude Code",
19 codex: "Codex",
20 grok: "Grok Build",
21 cursor: "Cursor",
22 opencode: "OpenCode",
23 antigravity: "Antigravity",
24};
25
26/**
27 * Claude's brand orange holds in both themes; Codex and Grok are neutrals and
28 * must flip with the theme or their bars vanish against the matching background.
29 */
30export function useProviderColors(): Record<UsageProviderKind, string> {
31 const { themeAppearance: scheme } = useAppearancePreferences();
32 return {
33 claude: "#d97757",
34 codex: scheme === "dark" ? "#e6e6e6" : "#3c3c43",
35 grok: scheme === "dark" ? "#a1a1aa" : "#52525b",
36 cursor: "#8b8b8b",
37 opencode: "#5b9bbd",
38 antigravity: "#8c7bd1",
39 };
40}