diff options
author | ubq323 <ubq323@ubq323.website> | 2022-12-31 03:13:55 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-12-31 03:13:55 +0000 |
commit | 532c32736b764292dfa5b20fef3b7675e148743b (patch) | |
tree | 263f22dd67953ce7ae5d828b2f04514fe713cf7c | |
parent | 3aed08a495dd9a712e50ded76c4b930067debe61 (diff) |
pride
-rw-r--r-- | pride.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pride.lua b/pride.lua new file mode 100644 index 0000000..8154e08 --- /dev/null +++ b/pride.lua @@ -0,0 +1,23 @@ + +local p = peripheral.wrap"right" + +function flag(cols,amount) + -- cols is list, top to bottom + local n = #cols + local csz = math.floor(16/n) + assert(csz>0, "too many stripes!") + + p.reset() + local function q(i,c) + local yM,ym = 16-(i*csz), 16-(i*csz)-csz + return { 0, ym, 15, 16, yM, 16, texture="sc-peripherals:block/white", tint=c } + end + local shapes = {} + for i,col in ipairs(cols) do + shapes[i] = q(i,col) + end + p.addshapes(shapes) + p.commit(amount or 1) + +end + |