True color (24 bit) is not 256 color (8 bit). Copied from another of my answers:
When I had this problem, it was because my vim colorscheme was using truecolor (24 bit) and tmux only supports 8bit (256 colors).
Here are the methods to check color support:
First, make sure you have 256 color support in your default terminal and tmux with this python script:
#!/usr/bin/env python
# Copyright (C) 2006 by Johannes Zellner, <[email protected]>
# modified by [email protected] to fit my output needs
# modified by [email protected] to fit my output needs
import sys
import os
def echo(msg):
os.system('echo -n "' + str(msg) + '"')
def out(n):
os.system("tput setab " + str(n) + "; echo -n " + ("\"% 4d\"" % n))
os.system("tput setab 0")
# normal colors 1 - 16
os.system("tput setaf 16")
for n in range(8):
out(n)
echo("\n")
for n in range(8, 16):
out(n)
echo("\n")
echo("\n")
y=16
while y < 231:
for z in range(0,6):
out(y)
y += 1
echo("\n")
echo("\n")
for n in range(232, 256):
out(n)
if n == 237 or n == 243 or n == 249:
echo("\n")
echo("\n")
os.system("tput setaf 7")
os.system("tput setab 0")
The expected output is to have each line be a different color, with a max of 1 white line. If there are more lines with white text on black background, you do not have 256 colors enabled.
Next, check that you have truecolor support in your terminal/tmux with this bash script:
#!/bin/bash
# Based on: https://gist.github.com/XVilka/8346728
awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{
s="/\\";
for (colnum = 0; colnum<term_cols; colnum++) {
r = 255-(colnum*255/term_cols);
g = (colnum*510/term_cols);
b = (colnum*255/term_cols);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum%2+1,1);
}
printf "\n";
}'
The expected output of this one looks like this:
The expected behavior is that tmux will support 256 color but not truecolor, and that your terminal will support both. If this is true, and your vim colorscheme still looks bad, it is very likely that you are using a truecolor colorscheme and tmux cannot support that. You can either switch to a 256 color version or just be sad about it. Sorry for the lack of good news.