mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Reformat
This commit is contained in:
parent
6ba476b8e1
commit
82f0548bdd
1 changed files with 9 additions and 2 deletions
|
@ -183,8 +183,15 @@ class ThemeManager:
|
||||||
def qcolor(self, colors: dict[str, str]) -> QColor:
|
def qcolor(self, colors: dict[str, str]) -> QColor:
|
||||||
"""Create QColor instance from CSS string for the current theme."""
|
"""Create QColor instance from CSS string for the current theme."""
|
||||||
|
|
||||||
if m:= re.match(r"rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+\.*\d+?)\)", self.var(colors)):
|
if m := re.match(
|
||||||
return QColor(int(m.group(1)), int(m.group(2)), int(m.group(3)), 255 * float(m.group(4)))
|
r"rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+\.*\d+?)\)", self.var(colors)
|
||||||
|
):
|
||||||
|
return QColor(
|
||||||
|
int(m.group(1)),
|
||||||
|
int(m.group(2)),
|
||||||
|
int(m.group(3)),
|
||||||
|
255 * float(m.group(4)),
|
||||||
|
)
|
||||||
return QColor(self.var(colors))
|
return QColor(self.var(colors))
|
||||||
|
|
||||||
def _determine_night_mode(self) -> bool:
|
def _determine_night_mode(self) -> bool:
|
||||||
|
|
Loading…
Reference in a new issue