2 # -*- coding: utf-8 -*-
5 # 1. Save as `vt-color-scheme.py`
7 # 3. Go to https://terminal.sexy and make your own color scheme
8 # 4. Export as JSON (easier to work with) and edit TANGO_SCHEME
9 # with the colors you chose
10 # 5. Run this script (redirect to text file if it's easier for you)
11 # 6. Paste the output as boot option in Lilo / Elilo etc.
13 KERNEL_PARAMS
= ['vt.default_red', 'vt.default_grn', 'vt.default_blu', ]
16 # https://material-ui.com/customization/default-theme/
36 def color_scheme_to_rgb_channel_data(color_scheme
):
38 [ '#r1g1b1', '#r2g2b2', ... ] => [ [r1, r2, ...], [g1, g2, ...], [b1, b2, ...], ]
41 def split_to_rgb(color
):
42 # rgb str -> [red, green, blue]
43 hex_value
= int(color
, 16)
44 return [hex_value
>> 16 & 255, hex_value
>> 8 & 255, hex_value
& 255]
46 return zip(*[split_to_rgb(color
.strip('#')) for color
in color_scheme
])
49 def prepare_param(param
, channel_data
):
50 return '{param}={values}'.format(param
=param
, values
=','.join(hex(byte
) for byte
in channel_data
))
54 print(' '.join(prepare_param(param
, channel
) for param
, channel
in \
55 zip(KERNEL_PARAMS
, color_scheme_to_rgb_channel_data(colors
))))
58 if __name__
== '__main__':