gnotclub / xst

st fork that uses Xresources and some pretty good patches
MIT License
537 stars 73 forks source link

Reverse attribute hides text when st.opacity = 0 #75

Open zzzaim opened 5 years ago

zzzaim commented 5 years ago

Text with the reverse attribute shows text in white background and foreground, therefore hides the text. This includes the block cursor.

xst screenshot:

screenshot

urxvt screenshot:

screenshot-urxvt

My xst specific Xresources:

st.termname: xst-256color
st.font: Hack:pixelsize=14:antialias=true:autohint=true
st.borderpx: 6
st.opacity: 0
st.bold_font: 0
st.cwscale: 1.1
st.chscale: 0.9

! vim: set ft=xdefaults:

Output of xrdb -query:

*background:    #151515
*color0:    #151515
*color1:    #ac4142
*color10:   #90a959
*color11:   #f4bf75
*color12:   #6a9fb5
*color13:   #aa759f
*color14:   #75b5aa
*color15:   #f5f5f5
*color16:   #d28445
*color17:   #8f5536
*color18:   #202020
*color19:   #303030
*color2:    #90a959
*color20:   #b0b0b0
*color21:   #e0e0e0
*color3:    #f4bf75
*color4:    #6a9fb5
*color5:    #aa759f
*color6:    #75b5aa
*color7:    #d0d0d0
*color8:    #505050
*color9:    #ac4142
*cursorColor:   #d0d0d0
*foreground:    #d0d0d0
URxvt*font: xft:Hack:pixelsize=14
URxvt*geometry: 120x32
URxvt*internalBorder:   6
URxvt*scrollBar:    false
URxvt*shading:  20
URxvt*transparent:  true
URxvt.keysym.Control-Left:  \033[1;5D
URxvt.keysym.Control-Right: \033[1;5C
URxvt.matcher.button:   2
URxvt.perl-ext-common:  default,matcher,resize-font
URxvt.url-launcher: /usr/bin/xdg-open
Xft.rgba:   rgb
st.bold_font:   0
st.borderpx:    6
st.chscale: 0.9
st.cwscale: 1.1
st.font:    Hack:pixelsize=14:antialias=true:autohint=true
st.opacity: 0
st.termname:    xst-256color
zzzaim commented 5 years ago

This issue has something to do with alpha. Text foreground color when in reverse mode somehow uses the alpha set by st.opacity. So my st.opacity: 0 setting actually makes reverse texts transparent.

actionless commented 2 years ago

So my st.opacity: 0 setting actually makes reverse texts transparent.

isn't this an intended behavior though?

UPD: ah, that would require to have some logic which would remove the alpha from the colored backgound behind the text, so the text would be actually transparent

so indeed discrading alpha component for reversed should be the best way to go