Created
January 14, 2018 22:58
-
-
Save piec/56a9f3eba5374db589801e213da6645e to your computer and use it in GitHub Desktop.
Test Terminal "true color" (24 bit) color escape sequences
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#Based on https://github.com/jonathanslenders/pymux/blob/master/examples/true_color_test.py | |
from __future__ import unicode_literals, print_function | |
import sys | |
n = 20 | |
if len(sys.argv) > 1: | |
n = int(sys.argv[1]) | |
def go(f): | |
print('\\x1b' + f[1:]) | |
for r in range(0, 5*n, 5): | |
for g in range(50, 200): | |
b = 150 | |
print(f % (r, g, b), end='') | |
print('\x1b[0m \n', end='') | |
print("") | |
go('\x1b[0;48;2;%s;%s;%sm ') | |
go('\x1b[0;48;2;%s:%s:%sm ') | |
go('\x1b[0;48;2:%s:%s:%sm ') | |
# with colorspace | |
go('\x1b[0;48;2:1:%s:%s:%sm ') | |
print('\x1b[0m\r\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment