do not overwrite the top 8 colors of the palette with black

This commit is contained in:
Michael Hudson-Doyle 2017-10-10 21:36:06 +13:00
parent 74e2cf1ccb
commit bf85eaf05f
2 changed files with 5 additions and 2 deletions

View File

@ -47,7 +47,7 @@ URWID_16_NAMES = [
URWID16 = {}
URWID256 = {}
PALETTE = bytearray(16*3)
PALETTE = bytearray(8*3)
colors = {
0: ("bg", (0x00, 0x00, 0x00)),

View File

@ -44,7 +44,10 @@ UO_R, UO_G, UO_B = 0xe9, 0x54, 0x20
def setup_ubuntu_orange(pal, additional_opts):
"""Overwrite color 4 (usually "dark blue") to Ubuntu orange."""
if is_linux_tty():
fcntl.ioctl(sys.stdout.fileno(), PIO_CMAP, pal)
curpal = bytearray(16*3)
fcntl.ioctl(sys.stdout.fileno(), GIO_CMAP, curpal)
curpal[:8] = pal
fcntl.ioctl(sys.stdout.fileno(), PIO_CMAP, curpal)
elif os.environ['TERM'] == 'fbterm':
print('\033[3;4;%i;%i;%i}' % (UO_R, UO_G, UO_B), flush=True)
else: