diff --git a/ui/theme/material3.py b/ui/theme/material3.py index 80e990a..510eb5b 100644 --- a/ui/theme/material3.py +++ b/ui/theme/material3.py @@ -135,7 +135,23 @@ class Material3DynamicThemeImpl(ThemeImpl): } EXTENDED_COLORS = { - "success": "#00c555", + "light": { + "success": "#00c555", + "past": "#5cbad3", + "present": "#829438", + "future": "#913a79", + "beyond": "#bf0d25", + "eternal": "#8b77a4", + "pure": "#f22ec6", + "far": "#ff9028", + "lost": "#ff0c43", + }, + "dark": { + "present": "#B5C76F", + "future": "#C56DAC", + "beyond": "#F24058", + "eternal": "#D3B5F9", + }, } def __init__(self, themeData: TMaterial3DynamicThemeData, scheme: _TScheme): @@ -170,6 +186,13 @@ class Material3DynamicThemeImpl(ThemeImpl): _hexToHct(tertiary_color) ) + def extendedColor(self, key: str) -> str: + preferred_color = self.EXTENDED_COLORS[self.actualScheme].get(key) + if preferred_color: + return preferred_color + + return self.EXTENDED_COLORS["light"][key] + @property def info(self): return ThemeInfo( @@ -204,7 +227,9 @@ class Material3DynamicThemeImpl(ThemeImpl): errorHct = MaterialDynamicColors.error.get_hct(self.material3Scheme) extendedPalettes: dict[str, DynamicColor] = {} - for colorName, colorHex in self.EXTENDED_COLORS.items(): + extendedColors = ["success"] + for colorName in extendedColors: + colorHex = self.extendedColor(colorName) colorHct = _hexToHct(colorHex) colorHarmonized = Blend.harmonize(colorHct.to_int(), primaryHct.to_int()) @@ -232,6 +257,24 @@ class Material3DynamicThemeImpl(ThemeImpl): ) ) + # arcaea colors + arcaeaColors: dict[str, Hct] = {} + arcaeaColorKeys = [ + "past", + "present", + "future", + "beyond", + "eternal", + "pure", + "far", + "lost", + ] + for colorName in arcaeaColorKeys: + colorHex = self.extendedColor(colorName) + colorHct = _hexToHct(colorHex) + colorHarmonized = Blend.harmonize(colorHct.to_int(), primaryHct.to_int()) + arcaeaColors[colorName] = Hct.from_int(colorHarmonized) + return CustomPalette( primary=_hctToQColor(primaryHct), secondary=_hctToQColor(secondaryHct), @@ -242,4 +285,12 @@ class Material3DynamicThemeImpl(ThemeImpl): error=_hctToQColor(errorHct), toolTipBase=self.qPalette.color(QPalette.ColorRole.ToolTipBase), toolTipText=self.qPalette.color(QPalette.ColorRole.ToolTipText), + past=_hctToQColor(arcaeaColors["past"]), + present=_hctToQColor(arcaeaColors["present"]), + future=_hctToQColor(arcaeaColors["future"]), + beyond=_hctToQColor(arcaeaColors["beyond"]), + eternal=_hctToQColor(arcaeaColors["eternal"]), + pure=_hctToQColor(arcaeaColors["pure"]), + far=_hctToQColor(arcaeaColors["far"]), + lost=_hctToQColor(arcaeaColors["lost"]), ) diff --git a/ui/theme/qml.py b/ui/theme/qml.py index 5eb50a5..d0f8e8d 100644 --- a/ui/theme/qml.py +++ b/ui/theme/qml.py @@ -51,3 +51,35 @@ class ThemeQmlExposer(QObject): @Property(QColor, notify=themeChanged) def toolTipText(self): return self._themeImpl.customPalette.toolTipText + + @Property(QColor, notify=themeChanged) + def past(self): + return self._themeImpl.customPalette.past + + @Property(QColor, notify=themeChanged) + def present(self): + return self._themeImpl.customPalette.present + + @Property(QColor, notify=themeChanged) + def future(self): + return self._themeImpl.customPalette.future + + @Property(QColor, notify=themeChanged) + def beyond(self): + return self._themeImpl.customPalette.beyond + + @Property(QColor, notify=themeChanged) + def eternal(self): + return self._themeImpl.customPalette.eternal + + @Property(QColor, notify=themeChanged) + def pure(self): + return self._themeImpl.customPalette.pure + + @Property(QColor, notify=themeChanged) + def far(self): + return self._themeImpl.customPalette.far + + @Property(QColor, notify=themeChanged) + def lost(self): + return self._themeImpl.customPalette.lost diff --git a/ui/theme/shared.py b/ui/theme/shared.py index dd7a110..2b09891 100644 --- a/ui/theme/shared.py +++ b/ui/theme/shared.py @@ -15,6 +15,15 @@ class CustomPalette: toolTipBase: QColor = field(default_factory=lambda: QColor.fromRgb(0x616161)) toolTipText: QColor = field(default_factory=lambda: QColor.fromRgb(0x616161)) + past: QColor = field(default_factory=lambda: QColor.fromRgb(0x5CBAD3)) + present: QColor = field(default_factory=lambda: QColor.fromRgb(0x829438)) + future: QColor = field(default_factory=lambda: QColor.fromRgb(0x913A79)) + beyond: QColor = field(default_factory=lambda: QColor.fromRgb(0xBF0D25)) + eternal: QColor = field(default_factory=lambda: QColor.fromRgb(0x8B77A4)) + pure: QColor = field(default_factory=lambda: QColor.fromRgb(0xF22EC6)) + far: QColor = field(default_factory=lambda: QColor.fromRgb(0xFF9028)) + lost: QColor = field(default_factory=lambda: QColor.fromRgb(0xFF0C43)) + _TScheme = Literal["light", "dark"]