kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.12k stars 971 forks source link

Background opacity changes background color #6532

Closed JMans15 closed 1 year ago

JMans15 commented 1 year ago

Describe the bug The background color changes when opacity is not 1

To Reproduce Steps to reproduce the behavior:

  1. Set the background color to "C"
  2. Put the window on top of plain "C"
  3. Reduce opacity
  4. See that the rendered color is not "C"

Screenshots Here is a comparison between opacity = 1 and opacity = 0.8, no blur, on top of the same color as in the config so that it shouldn't change the color through the window. The window decoration has the exact same color and transparency 2023-08-07_13-35 2023-08-07_13-36

Environment details

kitty 0.29.2 created by Kovid Goyal
Linux archlinux 6.4.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 03 Aug 2023 16:02:01 +0000 x86_64
Arch Linux 6.4.8-arch1-1 (/dev/tty)

Running under: X11
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /usr/bin/zsh
Loaded config files:
  /home/mansj/.config/kitty/kitty.conf

Config options different from defaults:
background_opacity      0.8
editor                  nvim
enabled_layouts         ['splits', 'tall', 'fat']
font_family             FiraCode Nerd Font
font_size               13.0
initial_window_height   (720, 'px')
initial_window_width    (1280, 'px')
remember_window_size    False
symbol_map:
    U+23fb - U+23fe → Symbols Nerd Font Mono
    U+2665 - U+2665 → Symbols Nerd Font Mono
    U+26a1 - U+26a1 → Symbols Nerd Font Mono
    U+2b58 - U+2b58 → Symbols Nerd Font Mono
    U+e000 - U+e00a → Symbols Nerd Font Mono
    U+e0a0 - U+e0a3 → Symbols Nerd Font Mono
    U+e0b0 - U+e0d4 → Symbols Nerd Font Mono
    U+e200 - U+e2a9 → Symbols Nerd Font Mono
    U+e300 - U+e3e3 → Symbols Nerd Font Mono
    U+e5fa - U+e6aa → Symbols Nerd Font Mono
    U+e700 - U+e7c5 → Symbols Nerd Font Mono
    U+ea60 - U+ebeb → Symbols Nerd Font Mono
    U+f000 - U+f2e0 → Symbols Nerd Font Mono
    U+f300 - U+f32f → Symbols Nerd Font Mono
    U+f400 - U+f4a9 → Symbols Nerd Font Mono
    U+f500 - U+f8ff → Symbols Nerd Font Mono
    U+f0001 - U+f1af0 → Symbols Nerd Font Mono
tab_activity_symbol     •
tab_bar_edge            1
tab_bar_style           powerline
tab_title_template      {fmt.fg.orange}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}
window_padding_width    FloatEdges(left=5.0, top=5.0, right=5.0, bottom=5.0)
Added shortcuts:
    kitty_mod+alt+enter →  launch --location=hsplit
    kitty_mod+alt+left →  previous_tab
    kitty_mod+alt+right →  next_tab
Changed shortcuts:
    kitty_mod+down →  neighboring_window bottom
    kitty_mod+enter →  launch --location=vsplit
    kitty_mod+left →  neighboring_window left
    kitty_mod+right →  neighboring_window right
    kitty_mod+up →  neighboring_window up
Colors:
    active_border_color     #b4befe   
    active_tab_background   #cba6f7   
    active_tab_foreground   #11111b   
    background              #222638   
    bell_border_color       #f9e2af   
    color0                  #45475a   
    color1                  #f38ba8   
    color10                 #a6e3a1   
    color11                 #f9e2af   
    color12                 #89b4fa   
    color13                 #f5c2e7   
    color14                 #94e2d5   
    color15                 #a6adc8   
    color2                  #a6e3a1   
    color3                  #f9e2af   
    color4                  #89b4fa   
    color5                  #f5c2e7   
    color6                  #94e2d5   
    color7                  #bac2de   
    color8                  #585b70   
    color9                  #f38ba8   
    cursor                  #f5e0dc   
    cursor_text_color       #222638   
    foreground              #cdd6f4   
    inactive_border_color   #6c7086   
    inactive_tab_background #181825   
    inactive_tab_foreground #cdd6f4   
    mark1_background        #b4befe   
    mark1_foreground        #222638   
    mark2_background        #cba6f7   
    mark2_foreground        #222638   
    mark3_background        #74c7ec   
    mark3_foreground        #222638   
    selection_background    #f5e0dc   
    selection_foreground    #222638   
    tab_bar_background      #11111b   
    url_color               #f5e0dc   

Important environment variables seen by the kitty process:
    PATH                                /usr/local/sbin:/usr/local/bin:/usr/bin:/home/mansj/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin
    LANG                                fr_BE.UTF-8
    SHELL                               /usr/bin/zsh
    DISPLAY                             :0
    USER                                mansj
    XCURSOR_SIZE                        24
    LC_TIME                             fr_BE.UTF-8
    XDG_CONFIG_DIRS                     /home/mansj/.config/kdedefaults:/etc/xdg
    XDG_CURRENT_DESKTOP                 KDE
    XDG_DATA_DIRS                       /home/mansj/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
    XDG_RUNTIME_DIR                     /run/user/1000
    XDG_SEAT                            seat0
    XDG_SEAT_PATH                       /org/freedesktop/DisplayManager/Seat0
    XDG_SESSION_CLASS                   user
    XDG_SESSION_DESKTOP                 KDE
    XDG_SESSION_ID                      2
    XDG_SESSION_PATH                    /org/freedesktop/DisplayManager/Session1
    XDG_SESSION_TYPE                    x11
    XDG_VTNR                            2

Additional context I went through related issues and PRs and found about issue #6250 and commit e1ce6d0, but I don't know if it's the same problem and if that's what said commit was supposed to fix

kovidgoyal commented 1 year ago

Not something I care about, there is enough complexity in rendering with semi-transparency already. Patches welcome.

JMans15 commented 1 year ago

Just in case someone runs into the exact same problem, setting the background color to #1f2233 instead of #222638 yields the exact right color. Note that this corresponds to a 5 units shift in value (hue, sat, val) Also, I don't think it's a good reason to close an issue, someone else might want to look into it