summaryrefslogtreecommitdiff
path: root/pride.lua
blob: 8154e0854035236262bc45b8e57fdadd9e6e33f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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