-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
26 lines (22 loc) · 879 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- Run to test functionality
local colors = require("plugin")
-- Theme is a way of setting up specific keys that map to colors
-- to be able to easily change
local theme = {
background={"amber", "400"},
text={"grey", "800"}
}
colors.setTheme(theme)
-- Create a rectangle with the theme color called "background"
local rect = display.newRect(0, display.contentHeight / 2, display.contentWidth * 2, 100)
colors.setThemeFillColorFor(rect, "background", 1)
-- Create some text with the theme color called "text"
local text = display.newText({
x=display.contentWidth / 2,
y=display.contentHeight / 2,
text="Hello world"
})
colors.setThemeFillColorFor(text, "text", 1)
-- Create a circle with a color specified directly (without theme)
local circle = display.newCircle(display.contentWidth / 2, display.contentHeight / 4, 50)
colors.setFillColorFor(circle, "blue", "400", 1)