generate-alt-random: emit “Set Raster Attributes” before color definitions

This commit is contained in:
Daniel Eklöf 2021-03-09 11:36:56 +01:00
parent a3f2e2220a
commit 0bc98877f3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -184,6 +184,10 @@ def main():
# Begin sixel
out.write('\033Pq')
# Sixel size. Without this, sixels will be
# auto-resized on cell-boundaries.
out.write(f'"1;1;{six_width};{six_height}')
# Set up 256 random colors
for idx in range(256):
# param 2: 1=HLS, 2=RGB.
@ -191,10 +195,6 @@ def main():
# (except 'hue' which is 0..360)
out.write(f'#{idx};2;{random.randrange(101)};{random.randrange(101)};{random.randrange(101)}')
# Sixel size. Without this, sixels will be
# auto-resized on cell-boundaries.
out.write(f'"1;1;{six_width};{six_height}')
for row in range(six_height // 6): # Each sixel is 6 pixels
band_count = random.randrange(32)
for band in range(band_count):