Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- WARNING: Updating a large amount of Glowstone Illuminators will cause framerate lag!
- local function disperse(col)
- for _,n in pairs(peripheral.getNames()) do
- if peripheral.getType(n) == "glowstone_illuminator" then
- peripheral.call(n, "setColor", col)
- end
- end
- end
- local source = {R = 0; G = 0; B = 0;}
- local function fade(target)
- for i = 0, 30 do
- local ratio = i/30
- local red = math.floor(target.R * ratio + source.R * (1-ratio))
- local green = math.floor(target.G * ratio + source.G * (1-ratio))
- local blue = math.floor(target.B * ratio + source.B * (1-ratio))
- disperse(bit.bor(bit.blshift(bit.bor(bit.blshift(red, 8), green), 8), blue))
- sleep(0.5)
- end
- source = target
- end
- while true do
- fade({R = math.random(0,255); G = math.random(0,255); B = math.random(0,255);})
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement