aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-09 10:36:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-11 16:33:00 +0000
commit0bc98877f35ef56e127aecc3df3aff986a4c3c93 (patch)
tree3101ca3e3764c862b1d7401ffa563e7dcd54d800 /scripts
parentgenerate-alt-random: 50% chance of overwriting the last sixel (diff)
generate-alt-random: emit “Set Raster Attributes” before color definitions
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-alt-random-writes.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/generate-alt-random-writes.py b/scripts/generate-alt-random-writes.py
index ec671fd3..30b7e9c9 100755
--- a/scripts/generate-alt-random-writes.py
+++ b/scripts/generate-alt-random-writes.py
@@ -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):