Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = {}
- local c = ""
- if v == 0 then p = colors.white
- c = "white"
- elseif v == 1 then p = colors.orange
- c = "orange"
- elseif v == 2 then p = colors.magenta
- c = "magenta"
- elseif v == 3 then p = colors.lightBlue
- c = "light blue"
- elseif v == 4 then p = colors.yellow
- c = "yellow"
- elseif v == 5 then p = colors.lime
- c = "lime"
- elseif v == 6 then p = colors.pink
- c = "pink"
- elseif v == 7 then p = colors.gray
- c = "gray"
- elseif v == 8 then p = colors.lightGray
- c = "light gray"
- elseif v == 9 then p = colors.cyan
- c = "cyan"
- elseif v == 10 then p = colors.purple
- c = "purple"
- elseif v == 11 then p = colors.blue
- c = "blue"
- elseif v == 12 then p = colors.brown
- c = "brown"
- elseif v == 13 then p = colors.green
- c = "green"
- elseif v == 14 then p = colors.red
- c = "red"
- elseif v == 15 then p = colors.black
- c = "black"
- else p = colors.black
- c = "black"
- end
- return p, c
- end
- local monitor = peripheral.find("monitor")
- term.redirect(monitor)
- local scale = monitor.getTextScale()
- local size = monitor.getSize()
- print("current text scale is " .. scale)
- print("current screen size is " .. size)
- sleep(5)
- monitor.clear()
- local header = window.create(term.current(), 1, 1, 29, 1)
- header.setBackgroundColor(colors.gray)
- local body = window.create(term.current(), 1,2, 29, 18)
- body.setBackgroundColor(colors.black)
- header.write("Color Testing")
- term.redirect(body)
- function drawLoop()
- for i=0, 15 do
- local curColor, curName = getColor(i)
- body.setTextColor(curColor)
- body.setBackgroundColor(colors.black)
- if i == 15 then body.setBackgroundColor(colors.white) end
- print("Hello World! - " .. curName)
- sleep(1)
- end
- end
- while true do drawLoop() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement