mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2026-02-27 16:11:09 +00:00
feat(ui.theme): add arcaea colors
This commit is contained in:
@ -135,7 +135,23 @@ class Material3DynamicThemeImpl(ThemeImpl):
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXTENDED_COLORS = {
|
EXTENDED_COLORS = {
|
||||||
|
"light": {
|
||||||
"success": "#00c555",
|
"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):
|
def __init__(self, themeData: TMaterial3DynamicThemeData, scheme: _TScheme):
|
||||||
@ -170,6 +186,13 @@ class Material3DynamicThemeImpl(ThemeImpl):
|
|||||||
_hexToHct(tertiary_color)
|
_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
|
@property
|
||||||
def info(self):
|
def info(self):
|
||||||
return ThemeInfo(
|
return ThemeInfo(
|
||||||
@ -204,7 +227,9 @@ class Material3DynamicThemeImpl(ThemeImpl):
|
|||||||
errorHct = MaterialDynamicColors.error.get_hct(self.material3Scheme)
|
errorHct = MaterialDynamicColors.error.get_hct(self.material3Scheme)
|
||||||
|
|
||||||
extendedPalettes: dict[str, DynamicColor] = {}
|
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)
|
colorHct = _hexToHct(colorHex)
|
||||||
colorHarmonized = Blend.harmonize(colorHct.to_int(), primaryHct.to_int())
|
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(
|
return CustomPalette(
|
||||||
primary=_hctToQColor(primaryHct),
|
primary=_hctToQColor(primaryHct),
|
||||||
secondary=_hctToQColor(secondaryHct),
|
secondary=_hctToQColor(secondaryHct),
|
||||||
@ -242,4 +285,12 @@ class Material3DynamicThemeImpl(ThemeImpl):
|
|||||||
error=_hctToQColor(errorHct),
|
error=_hctToQColor(errorHct),
|
||||||
toolTipBase=self.qPalette.color(QPalette.ColorRole.ToolTipBase),
|
toolTipBase=self.qPalette.color(QPalette.ColorRole.ToolTipBase),
|
||||||
toolTipText=self.qPalette.color(QPalette.ColorRole.ToolTipText),
|
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"]),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -51,3 +51,35 @@ class ThemeQmlExposer(QObject):
|
|||||||
@Property(QColor, notify=themeChanged)
|
@Property(QColor, notify=themeChanged)
|
||||||
def toolTipText(self):
|
def toolTipText(self):
|
||||||
return self._themeImpl.customPalette.toolTipText
|
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
|
||||||
|
|||||||
@ -15,6 +15,15 @@ class CustomPalette:
|
|||||||
toolTipBase: QColor = field(default_factory=lambda: QColor.fromRgb(0x616161))
|
toolTipBase: QColor = field(default_factory=lambda: QColor.fromRgb(0x616161))
|
||||||
toolTipText: 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"]
|
_TScheme = Literal["light", "dark"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user