Codi font per a qilisdk.utils.visualization.themes

# Copyright 2025 Qilimanjaro Quantum Tech
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Final

from pydantic import BaseModel, ConfigDict, Field

[documents] WHITE: Final[str] = "#FFFFFF"
[documents] BLACK: Final[str] = "#000000"
# Neutral ramp (light → dark)
[documents] NEUTRAL_050: Final[str] = "#F0F0F0"
[documents] NEUTRAL_100: Final[str] = "#DCDCDC"
[documents] NEUTRAL_200: Final[str] = "#CACACA"
[documents] NEUTRAL_600: Final[str] = "#7A7A7A"
[documents] NEUTRAL_800: Final[str] = "#2F2F2F"
[documents] NEUTRAL_900: Final[str] = "#1F1F1F"
# Brand colours
[documents] VIOLET: Final[str] = "#5E56A1"
[documents] MAGENTA: Final[str] = "#AC115F"
[documents] class Theme(BaseModel): """Colour Theme."""
[documents] model_config = ConfigDict(frozen=True)
[documents] background: str = Field(description="Canvas background.")
[documents] on_background: str = Field(description="Default text/line color on background.")
[documents] surface: str = Field(description="Raised surface/panel fill.")
[documents] on_surface: str = Field(description="Text/line color on surface.")
[documents] surface_muted: str = Field(description="Muted lines on background (wires/grid).")
[documents] border: str = Field(description="Neutral stroke/border color.")
[documents] primary: str = Field(description="Primary/brand fill.")
[documents] on_primary: str = Field(description="Text/icons over primary.")
[documents] accent: str = Field(description="Accent/highlight color.")
[documents] on_accent: str = Field(description="Text/icons over accent.")
[documents] light = Theme( background=WHITE, on_background=BLACK, surface=NEUTRAL_100, on_surface=BLACK, surface_muted=NEUTRAL_050, border=NEUTRAL_200, primary=VIOLET, on_primary=WHITE, accent=MAGENTA, on_accent=WHITE, )
[documents] dark = Theme( background=BLACK, on_background=WHITE, surface=NEUTRAL_800, on_surface=BLACK, surface_muted=NEUTRAL_900, border=NEUTRAL_600, primary=MAGENTA, on_primary=WHITE, accent=VIOLET, on_accent=WHITE, )