Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function convert(v,min1,max1,min2,max2)
- return math.floor((((v - min1) * (max2 - min2)) / (max1 - min1)) + min2)
- end
- function eventLoop()
- local t = os.date():sub(12,19)
- local h = t:sub(1,2)
- local m = t:sub(4,5)
- local s = t:sub(7,8)
- local r = string.format("%X", convert(h, 0, 23, 0, 255))
- local g = string.format("%X", convert(m, 0, 59, 0, 255))
- local b = string.format("%X", convert(s, 0, 59, 0, 255))
- local color = string.format("%02X%02X%02X", tonumber(r,16), tonumber(g,16), tonumber(b,16))
- local text1 = "<p align='center'><font size='36'>"..t.."</font></p>"
- local text2 = "<p align='center'><font size='24'>"..color.."</font></p>"
- ui.addTextArea(0, text1, nil, 20, 40, 200, 60, tonumber(color, 16), nil, 1, true)
- ui.addTextArea(1, text2, nil, 20, 120, 200, 36, tonumber(color, 16), nil, 1, true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement