@gphone/sdk
    Preparing search index...

    Function useTheme

    • Read and change the phone's color theme.

      Everything in the SDK is themed from one seed color: an app never names a color, it names a role (bg-surface-container, text-on-surface-variant) and the role follows whatever the player picked. So the only thing an app has any business setting is the seed, and that is all this exposes.

      schemeStore is the resolved token map, for the rare screen that needs a color as a value rather than as a class — a canvas fill, an inline SVG gradient. Reach for a utility class first; those are what the theme is actually delivered through.

      Returns {
          defaultTheme: ThemeState;
          isLightMode: Readable<boolean>;
          resetTheme: () => void;
          sanitizeSeed: (value: unknown) => string;
          schemeStore: Readable<M3Tokens>;
          seedFromRgbString: (value: string) => string | null;
          setThemeMode: (mode: ThemeMode) => void;
          setThemeSeed: (seed: string) => void;
          themeStore: Writable<ThemeState>;
      }

      • defaultTheme: ThemeState
      • isLightMode: Readable<boolean>

        Whether the light scheme is showing, for a toggle to bind to.

      • resetTheme: () => void
      • sanitizeSeed: (value: unknown) => string
      • schemeStore: Readable<M3Tokens>

        The 47 resolved token values for the active seed and mode.

      • seedFromRgbString: (value: string) => string | null

        Convert an rgb()/rgba() string — what a color picker emits — into a seed.

      • setThemeMode: (mode: ThemeMode) => void
      • setThemeSeed: (seed: string) => void
      • themeStore: Writable<ThemeState>