-
Notifications
You must be signed in to change notification settings - Fork 1
/
_Theme.story.luau
106 lines (97 loc) · 3.09 KB
/
_Theme.story.luau
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--!strict
local _Package = script.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
-- Modules
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))
-- Types
-- Constants
-- Variables
-- References
-- Class
return function(frame: Frame)
local maid = Maid.new()
task.spawn(function()
local function makeHalfFrame(isDarkMode: boolean, color: Color3): Frame
local style = Style.new(
1.25,
Enum.Font.SourceSans,
if isDarkMode then Enums.SchemeType.Dark else Enums.SchemeType.Light,
color
)
local halfFrame = maid:GiveTask(Instance.new("Frame"))
halfFrame.BackgroundColor3 = style:GetColor(Enums.ColorRoleType.Surface)
halfFrame.BorderSizePixel = 0
local listLayout = maid:GiveTask(Instance.new("UIListLayout"))
listLayout.FillDirection = Enum.FillDirection.Vertical
listLayout.Padding = UDim.new(0, 10)
listLayout.VerticalAlignment = Enum.VerticalAlignment.Center
listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
listLayout.Parent = halfFrame
local Module = require(script.Parent:WaitForChild("ColdFusion"))
do
local button = maid:GiveTask(Module.primary(style, function(val: number)
print(`value={val}`)
end, 50, 50, 150, 25))
button.Parent = halfFrame
end
-- do
-- local button = maid:GiveTask(Module.secondary(style, function(val: number)
-- print(`value={val}`)
-- end, 50, 0, 100, 25, nil, nil, 1))
-- button.Parent = halfFrame
-- end
-- do
-- local button = maid:GiveTask(Module.tertiary(style, function(val: number)
-- print(`value={val}`)
-- end, 50, 0, 100, 25, nil, nil, 1))
-- button.Parent = halfFrame
-- end
-- do
-- local button = maid:GiveTask(Module.onPrimary(style, function(val: number)
-- print(`value={val}`)
-- end, 50, 0, 100, 25, nil, nil, 1))
-- button.Parent = halfFrame
-- end
-- do
-- local button = maid:GiveTask(Module.onSecondary(style, function(val: number)
-- print(`value={val}`)
-- end, 50, 0, 100, 25, nil, nil, 1))
-- button.Parent = halfFrame
-- end
-- do
-- local button = maid:GiveTask(Module.onTertiary(style, function(val: number)
-- print(`value={val}`)
-- end, 50, 0, 100, 25, nil, nil, 1))
-- button.Parent = halfFrame
-- end
return halfFrame
end
local COLORS: { [number]: Color3 } = {
Color3.fromHSV(0, 0.9, 0.8),
-- Color3.fromHSV(0, 0.25, 0.8),
-- Color3.fromHSV(0, 0.9, 0.5),
Color3.fromHSV(0.6, 0.9, 0.7),
-- Color3.fromHSV(0.35, 0.9, 0.7),
-- Color3.fromHSV(0.1, 0.9, 0.7),
}
for i, color in ipairs(COLORS) do
local x = (i - 1) / #COLORS
local width = 1 / #COLORS
local dark = makeHalfFrame(true, color)
dark.Size = UDim2.fromScale(width, 0.5)
dark.Position = UDim2.fromScale(x, 0.5)
dark.Parent = frame
local bright = makeHalfFrame(false, color)
bright.Size = UDim2.fromScale(width, 0.5)
bright.Position = UDim2.fromScale(x, 0)
bright.Parent = frame
end
end)
return function()
maid:Destroy()
end
end