scripts: generate-alt-random: generate both opaque and transparent sixels

This commit is contained in:
Daniel Eklöf 2024-03-25 16:33:00 +01:00
parent 9fcf5977c0
commit dcd4ab4ab8
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -207,8 +207,9 @@ def main():
six_height, six_width = last_size
six_rows = (six_height + 5) // 6 # Round up; each sixel is 6 pixels
# Begin sixel (with P2=1 - empty sixels are transparent)
out.write('\033P;1q')
# Begin sixel (with P2 set to either 0 or 1 - opaque or transparent)
sixel_p2 = random.randrange(2)
out.write(f'\033P;{sixel_p2}q')
# Sixel size. Without this, sixels will be
# auto-resized on cell-boundaries.