Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --filax
- local component=require("component")
- local gpu=component.gpu
- local shell=require("shell")
- local event=require"event"
- local width,height=gpu.getResolution()
- local kill=false
- function clearScreen()
- gpu.fill(1,1,width,height," ")
- end
- function setbg(c) gpu.setBackground(c) end
- function setfg(c) gpu.setForeground(c) end
- function drawTopBar(color,title)
- setbg(color)
- setfg(0xFFFFFF)
- gpu.fill(1,1,width,1," ")
- gpu.set(width/2-string.len(title)/2,1,title)
- setbg(0xFF0000)
- setfg(0xFFFFFF)
- gpu.set(width,1,"x")
- event.listen("touch",function(_,x,y)
- if(x==width and y==1) then
- kill=true
- end
- end)
- end
- function rgbToHex(r, g, b)
- r = math.min(255, math.max(0, r))
- g = math.min(255, math.max(0, g))
- b = math.min(255, math.max(0, b))
- local hexR = string.format("%02X", r)
- local hexG = string.format("%02X", g)
- local hexB = string.format("%02X", b)
- return "#" .. hexR .. hexG .. hexB
- end
- clearScreen()
- drawTopBar(0x787878,"Filax")
- while true do
- if exit then
- clearScreen()
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement