from __future__ import annotations from .models.note import NOTE_COLORS # Notes and labels share one colour palette (their sets were identical). NOTE_COLORS # is the canonical vocabulary (defined on the model); this module is the single home # for the "clamp to the palette" normalizer so notes.py, labels.py and sync.py stop # each carrying their own copy. __all__ = ["NOTE_COLORS", "normalize_color"] def normalize_color(color: object) -> str: """Return `color` if it's a known palette key, else the default. One definition for both notes and labels.""" return color if color in NOTE_COLORS else "default"