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
# Neutral ramp (light → dark)
# Brand colours
[documents]
class Theme(BaseModel):
"""Colour Theme."""
[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,
)