mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
scripts: generate-alt-random: sixel: emit DECGRI - Repeat Character
This commit is contained in:
parent
5a93fc30ca
commit
add30a38f3
1 changed files with 6 additions and 5 deletions
|
|
@ -184,17 +184,18 @@ def main():
|
||||||
six_width = random.randrange(width // 2)
|
six_width = random.randrange(width // 2)
|
||||||
|
|
||||||
# Sixel size. Without this, sixels will be
|
# Sixel size. Without this, sixels will be
|
||||||
# auto-resized on cell-boundaries. We expect programs
|
# auto-resized on cell-boundaries.
|
||||||
# to emit this sequence since otherwise you cannot get
|
|
||||||
# correctly sized images.
|
|
||||||
out.write(f'"0;0;{six_width};{six_height}')
|
out.write(f'"0;0;{six_width};{six_height}')
|
||||||
|
|
||||||
for row in range(six_height // 6): # Each sixel is 6 pixels
|
for row in range(six_height // 6): # Each sixel is 6 pixels
|
||||||
# Choose a random color
|
# Choose a random color
|
||||||
out.write(f'#{random.randrange(256)}')
|
out.write(f'#{random.randrange(256)}')
|
||||||
|
|
||||||
for col in range(six_width):
|
if random.randrange(2):
|
||||||
out.write(f'{random.choice(sixels)}')
|
for col in range(six_width):
|
||||||
|
out.write(f'{random.choice(sixels)}')
|
||||||
|
else:
|
||||||
|
out.write(f'!{six_width}{random.choice(sixels)}')
|
||||||
|
|
||||||
# Next line
|
# Next line
|
||||||
out.write('-')
|
out.write('-')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue