Philipp Hörist pushed to branch master at gajim / gajim
Commits:
6a6683a1 by mjk at 2022-12-25T10:26:30+00:00
refactor: Adapt to nbxmpp text_to_color() changes
- - - - -
1 changed file:
- gajim/gtk/util.py
Changes:
=====================================
gajim/gtk/util.py
=====================================
@@ -41,8 +41,8 @@
from gi.repository import Pango
from gi.repository import GdkPixbuf
import cairo
-import nbxmpp
from nbxmpp import JID
+from nbxmpp import util as nbxmpp_util
from nbxmpp.structs import LocationData
from nbxmpp.structs import TuneData
@@ -503,10 +503,10 @@ def do_get_preferred_width(self) -> tuple[int, int]:
def text_to_color(text: str) -> tuple[float, float, float]:
if app.css_config.prefer_dark:
- background = (0, 0, 0) # RGB (0, 0, 0) black
+ lightness = 60
else:
- background = (1, 1, 1) # RGB (255, 255, 255) white
- return nbxmpp.util.text_to_color(text, background) # pyright: ignore
+ lightness = 40
+ return nbxmpp_util.text_to_color(text, 100, lightness)
def get_contact_color(contact: types.ChatContactT
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/6a6683a124d574c7449fa86a347e5fff2ec59ea3
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/6a6683a124d574c7449fa86a347e5fff2ec59ea3
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits