33 lines
506 B
Lua
33 lines
506 B
Lua
local math = require('math')
|
|
local paper = require('paper')
|
|
|
|
paper.init()
|
|
paper.set_rotation("portrait")
|
|
paper.clear()
|
|
|
|
local width = paper.get_width()
|
|
local height = paper.get_height()
|
|
|
|
print(
|
|
'width: ' .. width,
|
|
'height: ' .. height
|
|
)
|
|
|
|
paper.clear()
|
|
paper.fill_rect(0, 0, width, height, 0x22)
|
|
|
|
for i = 0, 4 do
|
|
local off = 40 * i
|
|
|
|
local color
|
|
if i % 2 == 0 then
|
|
color = 0x22
|
|
else
|
|
color = 0xDD
|
|
end
|
|
|
|
paper.fill_rect(off, off, width - off, height - off, color)
|
|
end
|
|
|
|
paper.update()
|
|
|