"""Mixlar Control theme colors — the exact palette the desktop app injects.

Inside the running app these names are injected into every plugin module's
namespace (``ACCENT``, ``CARD2``, ``WHITE`` …), which is why the shipped example
plugins reference them without importing anything. That injection means IDEs
can't resolve them at author time. Import them from here instead so you get
autocomplete and type-checking while writing, and identical values at runtime::

    from mixlar.colors import CARD2, WHITE, SEP

Values mirror ``PC Software/mixlar_mini.py`` (the source of truth). If the app is
already imported in-process, the live values are re-exported so a future palette
change in the app flows through automatically.
"""
from __future__ import annotations

import sys as _sys

# ── Canonical palette (mixlar_mini.py :2749) ─────────────────────────────────
CARD = "#2c2c2e"
CARD2 = "#3a3a3c"
ACCENT = "#ff4d14"   # Mixlar brand orange (from mixlar.net)
GREEN = "#30d158"
ORANGE = "#ff9f0a"
RED = "#ff453a"
PURPLE = "#bf5af2"
WHITE = "#ffffff"
GRAY = "#98989e"
SEP = "#38383a"

# UI font family the app uses (Segoe UI on Windows).
FONT = "Segoe UI" if _sys.platform == "win32" else (
    "SF Pro Display" if _sys.platform == "darwin" else "Ubuntu")

#: Every color constant the app injects into plugin modules, by name.
NAMES = ("ACCENT", "GREEN", "ORANGE", "PURPLE", "WHITE", "GRAY",
         "SEP", "CARD", "CARD2", "RED", "FONT")

# If running inside the live app, prefer its values (single source of truth).
from ._host import find_app as _find_app  # noqa: E402
_app = _find_app()
if _app is not None:  # pragma: no cover - only true inside the desktop app
    _g = getattr(_app, "__dict__", {})
    for _name in NAMES:
        if _name in _g:
            globals()[_name] = _g[_name]

__all__ = list(NAMES)
