From 07adab99cf5fcaca1994a2d4747a21e05bcbb07f Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 14 Mar 2020 21:44:43 -0600 Subject: [PATCH] More text + clean code a tad --- README.md | 16 ++++++++++++++-- wallart.py | 9 +++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4a41013..67aa05a 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,21 @@ This port is running on a 1x1 stick of wood, with tissue paper around it. It doesn't display anything significant. -It just looks interesting. +The idea is to have something to look at if you're idle, +without it being a distraction from more pressing issues. +If you're familiar with the album "music for airports", +it's that. -Most people, when they see it, +Most people, after watching it for a bit, form different ideas about what it's displaying. That's cool. + +History +------- + +I was trying to make pixels fade in and out, +and got the math wrong. +But what I wound up with looked more interesting +than what I was trying to make, +so I kept it. diff --git a/wallart.py b/wallart.py index 33be122..750874c 100644 --- a/wallart.py +++ b/wallart.py @@ -36,7 +36,6 @@ class GlitchPixel: bmask = (0xff * self.step // 32) & 0xff if self.step > self.nsteps/2: bmask = 0xff - bmask - #bmask = 0xff >> abs(4 - self.step) mask = (bmask << 16) | (bmask << 8) | (bmask << 0) color = self.color & mask grid[self.pos] = color @@ -47,18 +46,16 @@ class GlitchPixel: def fade(): reps = 300 + random.randrange(GRIDLEN) - hue = random.randrange(1000) + hue = random.randrange(256) colors = [fancy.CHSV(hue, 255, v).pack() for v in range(0, 256, 32)] rcolors = colors[:] rcolors.reverse() + colors = colors + rcolors for count in range(reps): pos = count % GRIDLEN for color in colors: grid[pos] = color pos -= 1 - for color in rcolors: - grid[pos] = color - pos -= 1 grid.show() def singleCursor(): @@ -88,7 +85,7 @@ def glitchPulse(): p = GlitchPixel() pixels.append(p) - for f in range(256): + for f in range(1000): for p in pixels: p.frame() grid.show()