Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/gtk/util.py
    ... ... @@ -41,8 +41,8 @@
    41 41
     from gi.repository import Pango
    
    42 42
     from gi.repository import GdkPixbuf
    
    43 43
     import cairo
    
    44
    -import nbxmpp
    
    45 44
     from nbxmpp import JID
    
    45
    +from nbxmpp import util as nbxmpp_util
    
    46 46
     from nbxmpp.structs import LocationData
    
    47 47
     from nbxmpp.structs import TuneData
    
    48 48
     
    
    ... ... @@ -503,10 +503,10 @@ def do_get_preferred_width(self) -> tuple[int, int]:
    503 503
     
    
    504 504
     def text_to_color(text: str) -> tuple[float, float, float]:
    
    505 505
         if app.css_config.prefer_dark:
    
    506
    -        background = (0, 0, 0)  # RGB (0, 0, 0) black
    
    506
    +        lightness = 60
    
    507 507
         else:
    
    508
    -        background = (1, 1, 1)  # RGB (255, 255, 255) white
    
    509
    -    return nbxmpp.util.text_to_color(text, background)  # pyright: ignore
    
    508
    +        lightness = 40
    
    509
    +    return nbxmpp_util.text_to_color(text, 100, lightness)
    
    510 510
     
    
    511 511
     
    
    512 512
     def get_contact_color(contact: types.ChatContactT