Ubuntu 18.04: Change color of window title bar

Is it possible to make the color of the title bar of the active window different from the rest?

Right now it's black for all windows in my default set-up. I am unable to determine if I can start typing as I don't know which the focused window is.


This works for me (Ubuntu 18.04 + Gnome 3.28.1):

nano ~/.config/gtk-3.0/gtk.css

To customize the active title bar background colors use .titlebar and .backdrop (for inactive windows).

.titlebar {
    background: #3089FF;
    color:white; 
}

.titlebar:backdrop  {
    background: #777777;
    color:white;
} 

After saving the file, remember refresh gnome using this command:

setsid gnome-shell --replace

A very simple way to make the color of the title bar different, is to choose a different theme, that does take this aspect into account (why the default one doesn't, beats me).

To change the default theme, install Gnome Tweaks (sudo apt install gnome-tweaks), then choose a theme like Adwaita:

Gnome Tweaks change theme