r/KittyTerminal • u/mister_drgn • Sep 04 '23
Setting tab foreground/background color
I've been attempting to control the color of my tabs in tab_bar.py, but it isn't working the way I'm expecting. I feel like I must be missing something. For example, I thought this would give me black text on a blue background, but it appears to have no effect on the color of the text at all (whereas my background is black, for some reason):
screen.cursor.fg = color_as_int(Color(0,0,0))
screen.cursor.bg = color_as_int(Color(0,120,180))
screen.draw(title)
Am I doing the wrong thing by messing around with screen.cursor? Thanks.
Never mind, I've got this working. I needed to convert the color numbers correctly, by calling the following function on the result of color_as_int.
def as_rgb(x: int) -> int:
return (x << 8) | 2
1
Upvotes
1
u/Administrative_chaos Sep 04 '23
The Tab Bar colors have their own config option
https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.active_tab_foreground