[F] Fix light dark detection
This commit is contained in:
parent
220b528c72
commit
09185e5a41
2 changed files with 3 additions and 1 deletions
|
@ -298,5 +298,6 @@ def get_fore_back(distro: str | None = None) -> tuple[int, int] | None:
|
||||||
fore_back = {
|
fore_back = {
|
||||||
'fedora': (2, 1),
|
'fedora': (2, 1),
|
||||||
'ubuntu': (2, 1),
|
'ubuntu': (2, 1),
|
||||||
|
'kubuntu': (2, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ class ColorProfile:
|
||||||
"""
|
"""
|
||||||
return ColorProfile([c.set_light(light, at_least, at_most) for c in self.colors])
|
return ColorProfile([c.set_light(light, at_least, at_most) for c in self.colors])
|
||||||
|
|
||||||
def set_light_dl(self, light: float, term: LightDark = GLOBAL_CFG.light_dark()):
|
def set_light_dl(self, light: float, term: LightDark | None = None):
|
||||||
"""
|
"""
|
||||||
Set HSL lightness value with respect to dark/light terminals
|
Set HSL lightness value with respect to dark/light terminals
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ class ColorProfile:
|
||||||
:param term: Terminal color (can be "dark" or "light")
|
:param term: Terminal color (can be "dark" or "light")
|
||||||
:return: New color profile (original isn't modified)
|
:return: New color profile (original isn't modified)
|
||||||
"""
|
"""
|
||||||
|
term = term or GLOBAL_CFG.light_dark()
|
||||||
assert term.lower() in ['light', 'dark']
|
assert term.lower() in ['light', 'dark']
|
||||||
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
||||||
return self.set_light_raw(light, at_least, at_most)
|
return self.set_light_raw(light, at_least, at_most)
|
||||||
|
|
Loading…
Reference in a new issue