@quenty/colorpicker 10.19.3 → 10.19.4-canary.559.339cfa7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +13 -13
- package/src/Client/ColorPickerUtils.lua +2 -2
- package/src/Client/Cursor/ColorPickerCursorPreview.lua +92 -62
- package/src/Client/Cursor/ColorPickerTriangle.lua +33 -22
- package/src/Client/Cursor/HSColorPickerCursor.lua +58 -39
- package/src/Client/HSV/HSColorPicker.lua +14 -14
- package/src/Client/HSV/HSColorPicker.story.lua +5 -4
- package/src/Client/HSV/HSVColorPicker.story.lua +5 -4
- package/src/Client/HSV/ValueColorPicker.lua +27 -27
- package/src/Client/HSV/ValueColorPicker.story.lua +4 -3
- package/src/Client/Story/ColorPickerStoryUtils.lua +71 -69
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.19.4-canary.559.339cfa7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpicker@10.19.3...@quenty/colorpicker@10.19.4-canary.559.339cfa7.0) (2025-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [10.19.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpicker@10.19.2...@quenty/colorpicker@10.19.3) (2025-04-10)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/colorpicker
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/colorpicker",
|
|
3
|
-
"version": "10.19.
|
|
3
|
+
"version": "10.19.4-canary.559.339cfa7.0",
|
|
4
4
|
"description": "Color picking UI system for Roblox.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@quenty/baseobject": "
|
|
32
|
-
"@quenty/basicpane": "
|
|
33
|
-
"@quenty/blend": "
|
|
34
|
-
"@quenty/buttondragmodel": "
|
|
35
|
-
"@quenty/color3utils": "
|
|
36
|
-
"@quenty/inputobjectutils": "
|
|
37
|
-
"@quenty/instanceutils": "
|
|
38
|
-
"@quenty/loader": "
|
|
39
|
-
"@quenty/maid": "
|
|
40
|
-
"@quenty/math": "
|
|
41
|
-
"@quenty/valueobject": "
|
|
31
|
+
"@quenty/baseobject": "10.8.4-canary.559.339cfa7.0",
|
|
32
|
+
"@quenty/basicpane": "13.17.4-canary.559.339cfa7.0",
|
|
33
|
+
"@quenty/blend": "12.18.4-canary.559.339cfa7.0",
|
|
34
|
+
"@quenty/buttondragmodel": "1.15.4-canary.559.339cfa7.0",
|
|
35
|
+
"@quenty/color3utils": "11.18.4-canary.559.339cfa7.0",
|
|
36
|
+
"@quenty/inputobjectutils": "4.18.4-canary.559.339cfa7.0",
|
|
37
|
+
"@quenty/instanceutils": "13.17.4-canary.559.339cfa7.0",
|
|
38
|
+
"@quenty/loader": "10.8.4-canary.559.339cfa7.0",
|
|
39
|
+
"@quenty/maid": "3.4.4-canary.559.339cfa7.0",
|
|
40
|
+
"@quenty/math": "2.7.3",
|
|
41
|
+
"@quenty/valueobject": "13.17.4-canary.559.339cfa7.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "339cfa778736f08768ed7305041f6221faa35bfc"
|
|
44
44
|
}
|
|
@@ -25,7 +25,7 @@ function ColorPickerUtils.getOutlineWithContrast(color: Color3, backingColor: Co
|
|
|
25
25
|
v = math.clamp(v - 80, 0, 100)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
return LuvColor3Utils.toColor3({l, u, v})
|
|
28
|
+
return LuvColor3Utils.toColor3({ l, u, v })
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
return ColorPickerUtils
|
|
31
|
+
return ColorPickerUtils
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Cursor preview for mobile input especially
|
|
3
4
|
@class ColorPickerCursorPreview
|
|
@@ -6,19 +7,35 @@
|
|
|
6
7
|
local require = require(script.Parent.loader).load(script)
|
|
7
8
|
|
|
8
9
|
local BasicPane = require("BasicPane")
|
|
9
|
-
local Blend = require("Blend")
|
|
10
10
|
local BasicPaneUtils = require("BasicPaneUtils")
|
|
11
|
-
local
|
|
11
|
+
local Blend = require("Blend")
|
|
12
12
|
local ColorPickerUtils = require("ColorPickerUtils")
|
|
13
13
|
local LuvColor3Utils = require("LuvColor3Utils")
|
|
14
|
+
local Math = require("Math")
|
|
15
|
+
local Signal = require("Signal")
|
|
14
16
|
local ValueObject = require("ValueObject")
|
|
15
17
|
|
|
16
18
|
local ColorPickerCursorPreview = setmetatable({}, BasicPane)
|
|
17
19
|
ColorPickerCursorPreview.ClassName = "ColorPickerCursorPreview"
|
|
18
20
|
ColorPickerCursorPreview.__index = ColorPickerCursorPreview
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
export type ColorPickerCursorPreview = typeof(setmetatable(
|
|
23
|
+
{} :: {
|
|
24
|
+
Gui: Frame?,
|
|
25
|
+
_transparency: ValueObject.ValueObject<number>,
|
|
26
|
+
_backgroundColorHint: ValueObject.ValueObject<Color3>,
|
|
27
|
+
_colorValue: ValueObject.ValueObject<Color3>,
|
|
28
|
+
_heightAbs: ValueObject.ValueObject<number>,
|
|
29
|
+
_offsetAbs: ValueObject.ValueObject<number>,
|
|
30
|
+
_position: ValueObject.ValueObject<Vector2>,
|
|
31
|
+
|
|
32
|
+
PositionChanged: Signal.Signal<Vector2>,
|
|
33
|
+
},
|
|
34
|
+
{} :: typeof({ __index = ColorPickerCursorPreview })
|
|
35
|
+
)) & BasicPane.BasicPane
|
|
36
|
+
|
|
37
|
+
function ColorPickerCursorPreview.new(): ColorPickerCursorPreview
|
|
38
|
+
local self: ColorPickerCursorPreview = setmetatable(BasicPane.new() :: any, ColorPickerCursorPreview)
|
|
22
39
|
|
|
23
40
|
self._backgroundColorHint = self._maid:Add(ValueObject.new(Color3.new(0, 0, 0), "Color3"))
|
|
24
41
|
self._heightAbs = self._maid:Add(ValueObject.new(60, "number"))
|
|
@@ -31,44 +48,48 @@ function ColorPickerCursorPreview.new()
|
|
|
31
48
|
self.Gui = gui
|
|
32
49
|
end))
|
|
33
50
|
|
|
34
|
-
self.PositionChanged = assert(self._position.Changed, "No .Changed event")
|
|
51
|
+
self.PositionChanged = assert(self._position.Changed :: any, "No .Changed event")
|
|
35
52
|
|
|
36
53
|
return self
|
|
37
54
|
end
|
|
38
55
|
|
|
39
|
-
function ColorPickerCursorPreview
|
|
56
|
+
function ColorPickerCursorPreview.HintBackgroundColor(self: ColorPickerCursorPreview, color: Color3)
|
|
40
57
|
assert(typeof(color) == "Color3", "Bad color")
|
|
41
58
|
|
|
42
59
|
self._backgroundColorHint.Value = color
|
|
43
60
|
end
|
|
44
61
|
|
|
45
|
-
function ColorPickerCursorPreview
|
|
62
|
+
function ColorPickerCursorPreview.SetPosition(self: ColorPickerCursorPreview, position: Vector2)
|
|
46
63
|
assert(typeof(position) == "Vector2", "Bad position")
|
|
47
64
|
|
|
48
65
|
self._position.Value = position
|
|
49
66
|
end
|
|
50
67
|
|
|
51
|
-
function ColorPickerCursorPreview
|
|
68
|
+
function ColorPickerCursorPreview.GetPosition(self: ColorPickerCursorPreview)
|
|
52
69
|
return self._position.Value
|
|
53
70
|
end
|
|
54
71
|
|
|
55
|
-
function ColorPickerCursorPreview
|
|
72
|
+
function ColorPickerCursorPreview.SetColor(self: ColorPickerCursorPreview, color: Color3)
|
|
56
73
|
assert(typeof(color) == "Color3", "Bad color")
|
|
57
74
|
|
|
58
75
|
self._colorValue.Value = color
|
|
59
76
|
end
|
|
60
77
|
|
|
61
|
-
function ColorPickerCursorPreview
|
|
78
|
+
function ColorPickerCursorPreview.SetTransparency(self: ColorPickerCursorPreview, transparency: number)
|
|
62
79
|
assert(type(transparency) == "number", "Bad transparency")
|
|
63
80
|
|
|
64
81
|
self._transparency.Value = transparency
|
|
65
82
|
end
|
|
66
83
|
|
|
67
|
-
function ColorPickerCursorPreview
|
|
84
|
+
function ColorPickerCursorPreview._render(self: ColorPickerCursorPreview)
|
|
68
85
|
local percentVisible = Blend.Spring(BasicPaneUtils.observePercentVisible(self), 30, 0.5)
|
|
69
|
-
local transparencyTarget = Blend.Computed(
|
|
70
|
-
|
|
71
|
-
|
|
86
|
+
local transparencyTarget = Blend.Computed(
|
|
87
|
+
BasicPaneUtils.observePercentVisible(self),
|
|
88
|
+
self._transparency,
|
|
89
|
+
function(visible, value)
|
|
90
|
+
return Math.map(visible, 0, 1, 1, value)
|
|
91
|
+
end
|
|
92
|
+
)
|
|
72
93
|
local transparency = Blend.Spring(transparencyTarget, 30)
|
|
73
94
|
local isOutlineVisible = Blend.Computed(self._colorValue, self._backgroundColorHint, function(color, backingColor)
|
|
74
95
|
local _, _, v = unpack(LuvColor3Utils.fromColor3(color))
|
|
@@ -77,56 +98,65 @@ function ColorPickerCursorPreview:_render()
|
|
|
77
98
|
return math.abs(bv - v) <= 60
|
|
78
99
|
end)
|
|
79
100
|
|
|
80
|
-
return Blend.New
|
|
81
|
-
Name = "Preview"
|
|
82
|
-
BackgroundTransparency = 1
|
|
101
|
+
return Blend.New("Frame")({
|
|
102
|
+
Name = "Preview",
|
|
103
|
+
BackgroundTransparency = 1,
|
|
83
104
|
Size = Blend.Computed(self._heightAbs, function(heightAbs)
|
|
84
105
|
return UDim2.fromOffset(heightAbs, heightAbs)
|
|
85
|
-
end)
|
|
86
|
-
AnchorPoint = Vector2.new(0.5, 0.5)
|
|
87
|
-
Position = Blend.Computed(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
end),
|
|
107
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
108
|
+
Position = Blend.Computed(
|
|
109
|
+
self._position,
|
|
110
|
+
self._offsetAbs,
|
|
111
|
+
self._heightAbs,
|
|
112
|
+
function(pos: Vector2, offsetAbs: number, heightAbs: number)
|
|
113
|
+
return UDim2.new(pos.X, 0, pos.Y, offsetAbs - heightAbs / 2)
|
|
114
|
+
end
|
|
115
|
+
),
|
|
116
|
+
ZIndex = 3,
|
|
117
|
+
|
|
118
|
+
Blend.New("UIAspectRatioConstraint")({
|
|
119
|
+
AspectRatio = 1,
|
|
120
|
+
}),
|
|
121
|
+
|
|
122
|
+
Blend.New("Frame")({
|
|
123
|
+
BackgroundTransparency = transparency,
|
|
124
|
+
BackgroundColor3 = self._colorValue,
|
|
125
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
126
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
127
|
+
Size = UDim2.fromScale(1, 1),
|
|
128
|
+
|
|
129
|
+
Blend.New("UIScale")({
|
|
130
|
+
Scale = percentVisible,
|
|
131
|
+
}),
|
|
132
|
+
|
|
133
|
+
Blend.New("UICorner")({
|
|
134
|
+
CornerRadius = UDim.new(1, 0),
|
|
135
|
+
}),
|
|
136
|
+
|
|
137
|
+
Blend.New("UIStroke")({
|
|
138
|
+
Color = Blend.Spring(
|
|
139
|
+
Blend.Computed(
|
|
140
|
+
self._colorValue,
|
|
141
|
+
self._backgroundColorHint,
|
|
142
|
+
isOutlineVisible,
|
|
143
|
+
function(color, backingColor, needed)
|
|
144
|
+
if needed then
|
|
145
|
+
return ColorPickerUtils.getOutlineWithContrast(color, backingColor)
|
|
146
|
+
else
|
|
147
|
+
return color
|
|
148
|
+
end
|
|
121
149
|
end
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
150
|
+
),
|
|
151
|
+
20
|
|
152
|
+
),
|
|
153
|
+
Transparency = transparency,
|
|
154
|
+
Thickness = Blend.Computed(percentVisible, function(percent: number)
|
|
155
|
+
return percent * 3
|
|
156
|
+
end),
|
|
157
|
+
}),
|
|
158
|
+
}),
|
|
159
|
+
})
|
|
130
160
|
end
|
|
131
161
|
|
|
132
|
-
return ColorPickerCursorPreview
|
|
162
|
+
return ColorPickerCursorPreview
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Color picker triangle
|
|
3
4
|
|
|
@@ -15,8 +16,19 @@ local ColorPickerTriangle = setmetatable({}, BaseObject)
|
|
|
15
16
|
ColorPickerTriangle.ClassName = "ColorPickerTriangle"
|
|
16
17
|
ColorPickerTriangle.__index = ColorPickerTriangle
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
export type ColorPickerTriangle = typeof(setmetatable(
|
|
20
|
+
{} :: {
|
|
21
|
+
Gui: Frame?,
|
|
22
|
+
_transparency: ValueObject.ValueObject<number>,
|
|
23
|
+
_backgroundColorHint: ValueObject.ValueObject<Color3>,
|
|
24
|
+
_color: ValueObject.ValueObject<Color3>,
|
|
25
|
+
_sizeValue: ValueObject.ValueObject<Vector2>,
|
|
26
|
+
},
|
|
27
|
+
{} :: typeof({ __index = ColorPickerTriangle })
|
|
28
|
+
)) & BaseObject.BaseObject
|
|
29
|
+
|
|
30
|
+
function ColorPickerTriangle.new(): ColorPickerTriangle
|
|
31
|
+
local self: ColorPickerTriangle = setmetatable(BaseObject.new() :: any, ColorPickerTriangle)
|
|
20
32
|
|
|
21
33
|
self._transparency = self._maid:Add(ValueObject.new(0, "number"))
|
|
22
34
|
self._backgroundColorHint = self._maid:Add(ValueObject.new(Color3.new(0, 0, 0), "Color3"))
|
|
@@ -30,55 +42,54 @@ function ColorPickerTriangle.new()
|
|
|
30
42
|
return self
|
|
31
43
|
end
|
|
32
44
|
|
|
33
|
-
function ColorPickerTriangle
|
|
45
|
+
function ColorPickerTriangle.HintBackgroundColor(self: ColorPickerTriangle, color: Color3)
|
|
34
46
|
self._backgroundColorHint.Value = color
|
|
35
47
|
end
|
|
36
48
|
|
|
37
|
-
function ColorPickerTriangle
|
|
49
|
+
function ColorPickerTriangle.GetSizeValue(self: ColorPickerTriangle): ValueObject.ValueObject<Vector2>
|
|
38
50
|
return self._sizeValue
|
|
39
51
|
end
|
|
40
52
|
|
|
41
|
-
function ColorPickerTriangle
|
|
53
|
+
function ColorPickerTriangle.GetMeasureValue(self: ColorPickerTriangle): ValueObject.ValueObject<Vector2>
|
|
42
54
|
return self._sizeValue
|
|
43
55
|
end
|
|
44
56
|
|
|
45
|
-
function ColorPickerTriangle
|
|
57
|
+
function ColorPickerTriangle.SetColor(self: ColorPickerTriangle, color: Color3)
|
|
46
58
|
self._color.Value = color
|
|
47
59
|
end
|
|
48
60
|
|
|
49
|
-
function ColorPickerTriangle
|
|
61
|
+
function ColorPickerTriangle.SetTransparency(self: ColorPickerTriangle, transparency: number)
|
|
50
62
|
assert(type(transparency) == "number", "Bad transparency")
|
|
51
63
|
|
|
52
64
|
self._transparency.Value = transparency
|
|
53
65
|
end
|
|
54
66
|
|
|
55
|
-
function ColorPickerTriangle
|
|
67
|
+
function ColorPickerTriangle._render(self: ColorPickerTriangle)
|
|
56
68
|
return Blend.New "Frame" {
|
|
57
|
-
Name = "ColorPickerTriangle"
|
|
58
|
-
Size = UDim2.new(1, 0, 1, 0)
|
|
59
|
-
BackgroundTransparency = 1
|
|
69
|
+
Name = "ColorPickerTriangle",
|
|
70
|
+
Size = UDim2.new(1, 0, 1, 0),
|
|
71
|
+
BackgroundTransparency = 1,
|
|
60
72
|
|
|
61
73
|
Blend.New "ImageLabel" {
|
|
62
|
-
BackgroundTransparency = 1
|
|
63
|
-
Size = UDim2.new(1, 0, 1, 0)
|
|
74
|
+
BackgroundTransparency = 1,
|
|
75
|
+
Size = UDim2.new(1, 0, 1, 0),
|
|
64
76
|
ImageColor3 = Blend.Computed(self._color, self._backgroundColorHint, function(color, backingColor)
|
|
65
77
|
return ColorPickerUtils.getOutlineWithContrast(color, backingColor)
|
|
66
|
-
end)
|
|
67
|
-
ImageTransparency = self._transparency
|
|
68
|
-
Image = "rbxassetid://9291514809"
|
|
69
|
-
}
|
|
78
|
+
end),
|
|
79
|
+
ImageTransparency = self._transparency,
|
|
80
|
+
Image = "rbxassetid://9291514809",
|
|
81
|
+
},
|
|
70
82
|
|
|
71
83
|
Blend.New "UIAspectRatioConstraint" {
|
|
72
84
|
AspectRatio = Blend.Computed(self._sizeValue, function(size)
|
|
73
85
|
if size.x <= 0 or size.y <= 0 then
|
|
74
86
|
return 1
|
|
75
87
|
else
|
|
76
|
-
return size.x/size.y
|
|
88
|
+
return size.x / size.y
|
|
77
89
|
end
|
|
78
|
-
end)
|
|
79
|
-
}
|
|
90
|
+
end),
|
|
91
|
+
},
|
|
80
92
|
}
|
|
81
93
|
end
|
|
82
94
|
|
|
83
|
-
|
|
84
|
-
return ColorPickerTriangle
|
|
95
|
+
return ColorPickerTriangle
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
The actual cursor for the HSV (it's a plus). See [HSVColorPicker].
|
|
3
4
|
|
|
@@ -9,14 +10,30 @@ local require = require(script.Parent.loader).load(script)
|
|
|
9
10
|
local BaseObject = require("BaseObject")
|
|
10
11
|
local Blend = require("Blend")
|
|
11
12
|
local ColorPickerUtils = require("ColorPickerUtils")
|
|
13
|
+
local Signal = require("Signal")
|
|
12
14
|
local ValueObject = require("ValueObject")
|
|
13
15
|
|
|
14
16
|
local HSColorPickerCursor = setmetatable({}, BaseObject)
|
|
15
17
|
HSColorPickerCursor.ClassName = "HSColorPickerCursor"
|
|
16
18
|
HSColorPickerCursor.__index = HSColorPickerCursor
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
export type HSColorPickerCursor = typeof(setmetatable(
|
|
21
|
+
{} :: {
|
|
22
|
+
Gui: Frame?,
|
|
23
|
+
_backgroundColorHint: ValueObject.ValueObject<Color3>,
|
|
24
|
+
_height: ValueObject.ValueObject<number>,
|
|
25
|
+
_crossHairWidthAbs: ValueObject.ValueObject<number>,
|
|
26
|
+
_verticalHairVisible: ValueObject.ValueObject<boolean>,
|
|
27
|
+
_horizontalHairVisible: ValueObject.ValueObject<boolean>,
|
|
28
|
+
_position: ValueObject.ValueObject<Vector2>,
|
|
29
|
+
_transparency: ValueObject.ValueObject<number>,
|
|
30
|
+
PositionChanged: Signal.Signal<Vector2>,
|
|
31
|
+
},
|
|
32
|
+
{} :: typeof({ __index = HSColorPickerCursor })
|
|
33
|
+
)) & BaseObject.BaseObject
|
|
34
|
+
|
|
35
|
+
function HSColorPickerCursor.new(): HSColorPickerCursor
|
|
36
|
+
local self: HSColorPickerCursor = setmetatable(BaseObject.new() :: any, HSColorPickerCursor)
|
|
20
37
|
|
|
21
38
|
self._backgroundColorHint = self._maid:Add(ValueObject.new(Color3.new(0, 0, 0), "Color3"))
|
|
22
39
|
self._height = self._maid:Add(ValueObject.new(0.075, "number"))
|
|
@@ -30,7 +47,7 @@ function HSColorPickerCursor.new()
|
|
|
30
47
|
self.Gui = gui
|
|
31
48
|
end))
|
|
32
49
|
|
|
33
|
-
self.PositionChanged = assert(self._position.Changed, "No .Changed event")
|
|
50
|
+
self.PositionChanged = assert(self._position.Changed :: any, "No .Changed event")
|
|
34
51
|
|
|
35
52
|
return self
|
|
36
53
|
end
|
|
@@ -40,17 +57,17 @@ end
|
|
|
40
57
|
|
|
41
58
|
@param color Color3
|
|
42
59
|
]=]
|
|
43
|
-
function HSColorPickerCursor
|
|
60
|
+
function HSColorPickerCursor.HintBackgroundColor(self: HSColorPickerCursor, color: Color3)
|
|
44
61
|
assert(typeof(color) == "Color3", "Bad color")
|
|
45
62
|
|
|
46
63
|
self._backgroundColorHint.Value = color
|
|
47
64
|
end
|
|
48
65
|
|
|
49
|
-
function HSColorPickerCursor
|
|
66
|
+
function HSColorPickerCursor.SetVerticalHairVisible(self: HSColorPickerCursor, visible)
|
|
50
67
|
self._verticalHairVisible.Value = visible
|
|
51
68
|
end
|
|
52
69
|
|
|
53
|
-
function HSColorPickerCursor
|
|
70
|
+
function HSColorPickerCursor.SetHorizontalHairVisible(self: HSColorPickerCursor, visible)
|
|
54
71
|
self._horizontalHairVisible.Value = visible
|
|
55
72
|
end
|
|
56
73
|
|
|
@@ -59,7 +76,7 @@ end
|
|
|
59
76
|
|
|
60
77
|
@param height number
|
|
61
78
|
]=]
|
|
62
|
-
function HSColorPickerCursor
|
|
79
|
+
function HSColorPickerCursor.SetHeight(self: HSColorPickerCursor, height)
|
|
63
80
|
self._height.Value = height
|
|
64
81
|
end
|
|
65
82
|
|
|
@@ -68,7 +85,7 @@ end
|
|
|
68
85
|
|
|
69
86
|
@param position Vector2
|
|
70
87
|
]=]
|
|
71
|
-
function HSColorPickerCursor
|
|
88
|
+
function HSColorPickerCursor.SetPosition(self: HSColorPickerCursor, position)
|
|
72
89
|
assert(typeof(position) == "Vector2", "Bad position")
|
|
73
90
|
|
|
74
91
|
self._position.Value = position
|
|
@@ -79,7 +96,7 @@ end
|
|
|
79
96
|
|
|
80
97
|
@return Vector2
|
|
81
98
|
]=]
|
|
82
|
-
function HSColorPickerCursor
|
|
99
|
+
function HSColorPickerCursor.GetPosition(self: HSColorPickerCursor)
|
|
83
100
|
return self._position.Value
|
|
84
101
|
end
|
|
85
102
|
|
|
@@ -88,63 +105,65 @@ end
|
|
|
88
105
|
|
|
89
106
|
@param transparency number
|
|
90
107
|
]=]
|
|
91
|
-
function HSColorPickerCursor
|
|
108
|
+
function HSColorPickerCursor.SetTransparency(self: HSColorPickerCursor, transparency: number)
|
|
92
109
|
assert(type(transparency) == "number", "Bad transparency")
|
|
93
110
|
|
|
94
111
|
self._transparency.Value = transparency
|
|
95
112
|
end
|
|
96
113
|
|
|
97
|
-
function HSColorPickerCursor
|
|
114
|
+
function HSColorPickerCursor._render(self: HSColorPickerCursor)
|
|
98
115
|
return Blend.New "Frame" {
|
|
99
|
-
Name = "HSColorPickerCursor"
|
|
116
|
+
Name = "HSColorPickerCursor",
|
|
100
117
|
Size = Blend.Computed(self._height, function(height)
|
|
101
118
|
return UDim2.fromScale(height, height)
|
|
102
|
-
end)
|
|
103
|
-
BackgroundTransparency = 1
|
|
104
|
-
AnchorPoint = Vector2.new(0.5, 0.5)
|
|
119
|
+
end),
|
|
120
|
+
BackgroundTransparency = 1,
|
|
121
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
105
122
|
Position = Blend.Computed(self._position, function(pos)
|
|
106
123
|
return UDim2.fromScale(pos.x, pos.y)
|
|
107
|
-
end)
|
|
124
|
+
end),
|
|
108
125
|
|
|
109
126
|
Blend.New "UIAspectRatioConstraint" {
|
|
110
|
-
AspectRatio = 1
|
|
111
|
-
}
|
|
127
|
+
AspectRatio = 1,
|
|
128
|
+
},
|
|
112
129
|
|
|
113
130
|
Blend.New "Frame" {
|
|
114
|
-
AnchorPoint = Vector2.new(0.5, 0.5)
|
|
115
|
-
Position = UDim2.fromScale(0.5, 0.5)
|
|
116
|
-
Visible = self._horizontalHairVisible
|
|
131
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
132
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
133
|
+
Visible = self._horizontalHairVisible,
|
|
117
134
|
Size = Blend.Computed(self._crossHairWidthAbs, function(width)
|
|
118
135
|
return UDim2.new(1, 0, 0, width)
|
|
119
|
-
end)
|
|
136
|
+
end),
|
|
120
137
|
BackgroundColor3 = Blend.Computed(self._backgroundColorHint, function(backingColor)
|
|
121
138
|
return ColorPickerUtils.getOutlineWithContrast(Color3.new(0, 0, 0), backingColor)
|
|
122
|
-
end)
|
|
123
|
-
BackgroundTransparency = self._transparency
|
|
139
|
+
end),
|
|
140
|
+
BackgroundTransparency = self._transparency,
|
|
124
141
|
|
|
125
142
|
Blend.New "UICorner" {
|
|
126
|
-
CornerRadius = UDim.new(1, 0)
|
|
127
|
-
}
|
|
128
|
-
}
|
|
143
|
+
CornerRadius = UDim.new(1, 0),
|
|
144
|
+
},
|
|
145
|
+
},
|
|
129
146
|
|
|
130
147
|
Blend.New "Frame" {
|
|
131
|
-
AnchorPoint = Vector2.new(0.5, 0.5)
|
|
132
|
-
Position = UDim2.fromScale(0.5, 0.5)
|
|
133
|
-
Visible = self._verticalHairVisible
|
|
148
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
149
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
150
|
+
Visible = self._verticalHairVisible,
|
|
134
151
|
Size = Blend.Computed(self._crossHairWidthAbs, function(width)
|
|
135
152
|
return UDim2.new(0, width, 1, 0)
|
|
136
|
-
end)
|
|
137
|
-
BackgroundColor3 = Blend.Spring(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
end),
|
|
154
|
+
BackgroundColor3 = Blend.Spring(
|
|
155
|
+
Blend.Computed(self._backgroundColorHint, function(backingColor)
|
|
156
|
+
return ColorPickerUtils.getOutlineWithContrast(Color3.new(0, 0, 0), backingColor)
|
|
157
|
+
end),
|
|
158
|
+
20
|
|
159
|
+
),
|
|
160
|
+
BackgroundTransparency = self._transparency,
|
|
141
161
|
|
|
142
162
|
Blend.New "UICorner" {
|
|
143
|
-
CornerRadius = UDim.new(1, 0)
|
|
144
|
-
}
|
|
145
|
-
}
|
|
163
|
+
CornerRadius = UDim.new(1, 0),
|
|
164
|
+
},
|
|
165
|
+
},
|
|
146
166
|
}
|
|
147
167
|
end
|
|
148
168
|
|
|
149
|
-
|
|
150
169
|
return HSColorPickerCursor
|
|
@@ -173,33 +173,33 @@ end
|
|
|
173
173
|
|
|
174
174
|
function HSColorPicker:_render()
|
|
175
175
|
return Blend.New "ImageButton" {
|
|
176
|
-
Name = "HSColorPicker"
|
|
177
|
-
Size = UDim2.new(1, 0, 1, 0)
|
|
178
|
-
BackgroundTransparency = 1
|
|
179
|
-
Active = true
|
|
180
|
-
Image = "rbxassetid://9290917908"
|
|
181
|
-
ImageTransparency = self._transparency
|
|
176
|
+
Name = "HSColorPicker",
|
|
177
|
+
Size = UDim2.new(1, 0, 1, 0),
|
|
178
|
+
BackgroundTransparency = 1,
|
|
179
|
+
Active = true,
|
|
180
|
+
Image = "rbxassetid://9290917908",
|
|
181
|
+
ImageTransparency = self._transparency,
|
|
182
182
|
|
|
183
183
|
[Blend.Instance] = function(inst)
|
|
184
184
|
self._dragModel:SetButton(inst)
|
|
185
|
-
end
|
|
185
|
+
end,
|
|
186
186
|
|
|
187
187
|
Blend.New "UIAspectRatioConstraint" {
|
|
188
188
|
AspectRatio = Blend.Computed(self._sizeValue, function(size)
|
|
189
189
|
if size.x <= 0 or size.y <= 0 then
|
|
190
190
|
return 1
|
|
191
191
|
else
|
|
192
|
-
return size.x/size.y
|
|
192
|
+
return size.x / size.y
|
|
193
193
|
end
|
|
194
|
-
end)
|
|
195
|
-
}
|
|
194
|
+
end),
|
|
195
|
+
},
|
|
196
196
|
|
|
197
197
|
Blend.New "UICorner" {
|
|
198
|
-
CornerRadius = UDim.new(0, 4)
|
|
199
|
-
}
|
|
198
|
+
CornerRadius = UDim.new(0, 4),
|
|
199
|
+
},
|
|
200
200
|
|
|
201
|
-
self._preview.Gui
|
|
202
|
-
self._cursor.Gui
|
|
201
|
+
self._preview.Gui,
|
|
202
|
+
self._cursor.Gui,
|
|
203
203
|
}
|
|
204
204
|
end
|
|
205
205
|
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
@class serviceBag.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
5
|
+
local require =
|
|
6
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
6
7
|
|
|
7
|
-
local Maid = require("Maid")
|
|
8
8
|
local HSColorPicker = require("HSColorPicker")
|
|
9
|
+
local Maid = require("Maid")
|
|
9
10
|
|
|
10
11
|
return function(target)
|
|
11
12
|
local maid = Maid.new()
|
|
@@ -13,11 +14,11 @@ return function(target)
|
|
|
13
14
|
local picker = maid:Add(HSColorPicker.new())
|
|
14
15
|
picker:SetColor(Color3.new(1, 1, 1))
|
|
15
16
|
picker.Gui.AnchorPoint = Vector2.new(0.5, 0.5)
|
|
16
|
-
picker.Gui.Position = UDim2.fromScale(0.5, 0.5)
|
|
17
|
+
picker.Gui.Position = UDim2.fromScale(0.5, 0.5)
|
|
17
18
|
picker.Gui.Size = UDim2.fromScale(0.8, 0.8)
|
|
18
19
|
picker.Gui.Parent = target
|
|
19
20
|
|
|
20
21
|
return function()
|
|
21
22
|
maid:DoCleaning()
|
|
22
23
|
end
|
|
23
|
-
end
|
|
24
|
+
end
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
@class HSVColorPicker.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
5
|
+
local require =
|
|
6
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
6
7
|
|
|
7
|
-
local Maid = require("Maid")
|
|
8
8
|
local HSVColorPicker = require("HSVColorPicker")
|
|
9
|
+
local Maid = require("Maid")
|
|
9
10
|
|
|
10
11
|
return function(target)
|
|
11
12
|
local maid = Maid.new()
|
|
@@ -13,11 +14,11 @@ return function(target)
|
|
|
13
14
|
local picker = maid:Add(HSVColorPicker.new())
|
|
14
15
|
picker:SetColor(Color3.new(0.5, 0.8, 0.3))
|
|
15
16
|
picker.Gui.AnchorPoint = Vector2.new(0.5, 0.5)
|
|
16
|
-
picker.Gui.Position = UDim2.fromScale(0.5, 0.5)
|
|
17
|
+
picker.Gui.Position = UDim2.fromScale(0.5, 0.5)
|
|
17
18
|
picker.Gui.Size = UDim2.fromScale(0.8, 0.8)
|
|
18
19
|
picker.Gui.Parent = target
|
|
19
20
|
|
|
20
21
|
return function()
|
|
21
22
|
maid:DoCleaning()
|
|
22
23
|
end
|
|
23
|
-
end
|
|
24
|
+
end
|
|
@@ -10,9 +10,9 @@ local require = require(script.Parent.loader).load(script)
|
|
|
10
10
|
local BaseObject = require("BaseObject")
|
|
11
11
|
local Blend = require("Blend")
|
|
12
12
|
local ButtonDragModel = require("ButtonDragModel")
|
|
13
|
-
local ValueObject = require("ValueObject")
|
|
14
13
|
local ColorPickerCursorPreview = require("ColorPickerCursorPreview")
|
|
15
14
|
local ColorPickerTriangle = require("ColorPickerTriangle")
|
|
15
|
+
local ValueObject = require("ValueObject")
|
|
16
16
|
|
|
17
17
|
local ValueColorPicker = setmetatable({}, BaseObject)
|
|
18
18
|
ValueColorPicker.ClassName = "ValueColorPicker"
|
|
@@ -203,35 +203,35 @@ end
|
|
|
203
203
|
|
|
204
204
|
function ValueColorPicker:_render()
|
|
205
205
|
return Blend.New "ImageButton" {
|
|
206
|
-
Name = "HSColorPicker"
|
|
207
|
-
Size = UDim2.new(1, 0, 1, 0)
|
|
208
|
-
BackgroundTransparency = 1
|
|
209
|
-
Active = true
|
|
206
|
+
Name = "HSColorPicker",
|
|
207
|
+
Size = UDim2.new(1, 0, 1, 0),
|
|
208
|
+
BackgroundTransparency = 1,
|
|
209
|
+
Active = true,
|
|
210
210
|
|
|
211
211
|
[Blend.Instance] = function(inst)
|
|
212
212
|
self._dragModel:SetButton(inst)
|
|
213
|
-
end
|
|
213
|
+
end,
|
|
214
214
|
|
|
215
215
|
Blend.New "UIAspectRatioConstraint" {
|
|
216
216
|
AspectRatio = Blend.Computed(self._sizeValue, function(size)
|
|
217
217
|
if size.x <= 0 or size.y <= 0 then
|
|
218
218
|
return 1
|
|
219
219
|
else
|
|
220
|
-
return size.x/size.y
|
|
220
|
+
return size.x / size.y
|
|
221
221
|
end
|
|
222
|
-
end)
|
|
223
|
-
}
|
|
222
|
+
end),
|
|
223
|
+
},
|
|
224
224
|
|
|
225
225
|
Blend.New "Frame" {
|
|
226
|
-
BackgroundColor3 = Color3.new(1, 1, 1)
|
|
227
|
-
BackgroundTransparency = self._transparency
|
|
226
|
+
BackgroundColor3 = Color3.new(1, 1, 1),
|
|
227
|
+
BackgroundTransparency = self._transparency,
|
|
228
228
|
Size = Blend.Computed(self._leftWidth, self._sizeValue, function(width, sizeValue)
|
|
229
229
|
if sizeValue.x == 0 then
|
|
230
230
|
return UDim2.new(0, 0, 1, 0)
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
-
return UDim2.new(width/sizeValue.x, 0, 1, 0)
|
|
234
|
-
end)
|
|
233
|
+
return UDim2.new(width / sizeValue.x, 0, 1, 0)
|
|
234
|
+
end),
|
|
235
235
|
|
|
236
236
|
Blend.New "UIGradient" {
|
|
237
237
|
Color = Blend.Computed(self._hsvColorValue, function(color)
|
|
@@ -239,31 +239,31 @@ function ValueColorPicker:_render()
|
|
|
239
239
|
local start = Color3.fromHSV(h, s, 0)
|
|
240
240
|
local finish = Color3.fromHSV(h, s, 1)
|
|
241
241
|
return ColorSequence.new(start, finish)
|
|
242
|
-
end)
|
|
243
|
-
Rotation = -90
|
|
244
|
-
}
|
|
242
|
+
end),
|
|
243
|
+
Rotation = -90,
|
|
244
|
+
},
|
|
245
245
|
Blend.New "UICorner" {
|
|
246
|
-
CornerRadius = UDim.new(0, 4)
|
|
247
|
-
}
|
|
246
|
+
CornerRadius = UDim.new(0, 4),
|
|
247
|
+
},
|
|
248
248
|
|
|
249
|
-
self._preview.Gui
|
|
249
|
+
self._preview.Gui,
|
|
250
250
|
-- self._cursor.Gui;
|
|
251
|
-
}
|
|
251
|
+
},
|
|
252
252
|
|
|
253
253
|
Blend.New "Frame" {
|
|
254
|
-
BackgroundTransparency = 1
|
|
255
|
-
Position = UDim2.fromScale(1, 0)
|
|
256
|
-
AnchorPoint = Vector2.new(1, 0)
|
|
254
|
+
BackgroundTransparency = 1,
|
|
255
|
+
Position = UDim2.fromScale(1, 0),
|
|
256
|
+
AnchorPoint = Vector2.new(1, 0),
|
|
257
257
|
Size = Blend.Computed(self._leftWidth, self._sizeValue, function(width, sizeValue)
|
|
258
258
|
if sizeValue.x == 0 then
|
|
259
259
|
return UDim2.new(0, 0, 1, 0)
|
|
260
260
|
end
|
|
261
261
|
|
|
262
|
-
return UDim2.new((sizeValue.x - width)/sizeValue.x, 0, 1, 0)
|
|
263
|
-
end)
|
|
262
|
+
return UDim2.new((sizeValue.x - width) / sizeValue.x, 0, 1, 0)
|
|
263
|
+
end),
|
|
264
264
|
|
|
265
|
-
self._triangle.Gui
|
|
266
|
-
}
|
|
265
|
+
self._triangle.Gui,
|
|
266
|
+
},
|
|
267
267
|
}
|
|
268
268
|
end
|
|
269
269
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
@class ValueColorPicker.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
5
|
+
local require =
|
|
6
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
6
7
|
|
|
7
8
|
local Maid = require("Maid")
|
|
8
9
|
local ValueColorPicker = require("ValueColorPicker")
|
|
@@ -13,11 +14,11 @@ return function(target)
|
|
|
13
14
|
local picker = maid:Add(ValueColorPicker.new())
|
|
14
15
|
picker:SetHSVColor(Vector3.new(1, 0.5, 1))
|
|
15
16
|
picker.Gui.AnchorPoint = Vector2.new(0.5, 0.5)
|
|
16
|
-
picker.Gui.Position = UDim2.fromScale(0.5, 0.5)
|
|
17
|
+
picker.Gui.Position = UDim2.fromScale(0.5, 0.5)
|
|
17
18
|
picker.Gui.Size = UDim2.fromScale(0.8, 0.8)
|
|
18
19
|
picker.Gui.Parent = target
|
|
19
20
|
|
|
20
21
|
return function()
|
|
21
22
|
maid:DoCleaning()
|
|
22
23
|
end
|
|
23
|
-
end
|
|
24
|
+
end
|
|
@@ -14,8 +14,8 @@ function ColorPickerStoryUtils.createPicker(maid, valueSync, labelText, currentV
|
|
|
14
14
|
local picker = maid:Add(HSVColorPicker.new())
|
|
15
15
|
picker.Gui.AnchorPoint = Vector2.new(0.5, 1)
|
|
16
16
|
picker.Gui.Position = UDim2.new(0.5, 0, 1, 0)
|
|
17
|
-
picker.Gui.Size = UDim2.new(0, 150, 1, -30)
|
|
18
|
-
picker.Gui.ZIndex = 2
|
|
17
|
+
picker.Gui.Size = UDim2.new(0, 150, 1, -30)
|
|
18
|
+
picker.Gui.ZIndex = 2
|
|
19
19
|
|
|
20
20
|
maid:GiveTask(picker:SyncValue(valueSync))
|
|
21
21
|
|
|
@@ -35,57 +35,59 @@ function ColorPickerStoryUtils.createPicker(maid, valueSync, labelText, currentV
|
|
|
35
35
|
end))
|
|
36
36
|
|
|
37
37
|
return Blend.New "ImageButton" {
|
|
38
|
-
BackgroundTransparency = 0
|
|
39
|
-
AutoButtonColor = true
|
|
40
|
-
BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
|
|
41
|
-
Size = Blend.Spring(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
BackgroundTransparency = 0,
|
|
39
|
+
AutoButtonColor = true,
|
|
40
|
+
BackgroundColor3 = Color3.new(0.2, 0.2, 0.2),
|
|
41
|
+
Size = Blend.Spring(
|
|
42
|
+
Blend.Computed(visible, function(isVisible)
|
|
43
|
+
if isVisible then
|
|
44
|
+
return UDim2.new(0, 170, 0, 190)
|
|
45
|
+
else
|
|
46
|
+
return UDim2.new(0, 170, 0, 50)
|
|
47
|
+
end
|
|
48
|
+
end),
|
|
49
|
+
40
|
|
50
|
+
),
|
|
51
|
+
ClipsDescendants = false,
|
|
49
52
|
[Blend.OnEvent "Activated"] = function()
|
|
50
53
|
visible.Value = not visible.Value
|
|
51
|
-
end
|
|
54
|
+
end,
|
|
52
55
|
|
|
53
|
-
picker.Gui
|
|
56
|
+
picker.Gui,
|
|
54
57
|
Blend.New "TextLabel" {
|
|
55
|
-
BackgroundTransparency = 1
|
|
56
|
-
Text = labelText
|
|
57
|
-
Position = UDim2.new(0, 35, 0, 5)
|
|
58
|
-
Size = UDim2.new(1, -40, 0, 20)
|
|
59
|
-
Font = Enum.Font.FredokaOne
|
|
60
|
-
TextXAlignment = Enum.TextXAlignment.Left
|
|
61
|
-
TextScaled = true
|
|
62
|
-
TextColor3 = Color3.new(1, 1, 1)
|
|
63
|
-
ZIndex = 0
|
|
64
|
-
}
|
|
58
|
+
BackgroundTransparency = 1,
|
|
59
|
+
Text = labelText,
|
|
60
|
+
Position = UDim2.new(0, 35, 0, 5),
|
|
61
|
+
Size = UDim2.new(1, -40, 0, 20),
|
|
62
|
+
Font = Enum.Font.FredokaOne,
|
|
63
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
64
|
+
TextScaled = true,
|
|
65
|
+
TextColor3 = Color3.new(1, 1, 1),
|
|
66
|
+
ZIndex = 0,
|
|
67
|
+
},
|
|
65
68
|
|
|
66
69
|
Blend.New "Frame" {
|
|
67
|
-
BackgroundColor3 = valueSync
|
|
68
|
-
Size = UDim2.new(0, 20, 0, 20)
|
|
69
|
-
Position = UDim2.new(0, 5, 0, 5)
|
|
70
|
+
BackgroundColor3 = valueSync,
|
|
71
|
+
Size = UDim2.new(0, 20, 0, 20),
|
|
72
|
+
Position = UDim2.new(0, 5, 0, 5),
|
|
70
73
|
[Blend.Children] = {
|
|
71
74
|
Blend.New "UICorner" {
|
|
72
|
-
CornerRadius = UDim.new(0, 10)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
75
|
+
CornerRadius = UDim.new(0, 10),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
76
79
|
|
|
77
80
|
Blend.New "UIPadding" {
|
|
78
|
-
PaddingTop = UDim.new(0, 10)
|
|
79
|
-
PaddingBottom = UDim.new(0, 10)
|
|
80
|
-
PaddingLeft = UDim.new(0, 10)
|
|
81
|
-
PaddingRight = UDim.new(0, 10)
|
|
82
|
-
}
|
|
81
|
+
PaddingTop = UDim.new(0, 10),
|
|
82
|
+
PaddingBottom = UDim.new(0, 10),
|
|
83
|
+
PaddingLeft = UDim.new(0, 10),
|
|
84
|
+
PaddingRight = UDim.new(0, 10),
|
|
85
|
+
},
|
|
83
86
|
|
|
84
87
|
Blend.New "UICorner" {
|
|
85
|
-
CornerRadius = UDim.new(0, 10)
|
|
86
|
-
}
|
|
88
|
+
CornerRadius = UDim.new(0, 10),
|
|
89
|
+
},
|
|
87
90
|
}
|
|
88
|
-
|
|
89
91
|
end
|
|
90
92
|
|
|
91
93
|
function ColorPickerStoryUtils.create(maid, buildPickers)
|
|
@@ -99,26 +101,26 @@ function ColorPickerStoryUtils.create(maid, buildPickers)
|
|
|
99
101
|
|
|
100
102
|
local function pickerGroup(pickers)
|
|
101
103
|
return Blend.New "Frame" {
|
|
102
|
-
Size = UDim2.new(1, 0, 0, 0)
|
|
103
|
-
AnchorPoint = Vector2.new(0.5, 0.5)
|
|
104
|
-
Position = UDim2.fromScale(0.5, 0.5)
|
|
105
|
-
BackgroundTransparency = 1
|
|
106
|
-
AutomaticSize = Enum.AutomaticSize.Y
|
|
104
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
105
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
106
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
107
|
+
BackgroundTransparency = 1,
|
|
108
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
107
109
|
|
|
108
110
|
Blend.New "UIListLayout" {
|
|
109
|
-
Padding = UDim.new(0, 10)
|
|
110
|
-
HorizontalAlignment = Enum.HorizontalAlignment.Left
|
|
111
|
-
VerticalAlignment = Enum.VerticalAlignment.Top
|
|
112
|
-
FillDirection = Enum.FillDirection.Horizontal
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
pickers
|
|
116
|
-
}
|
|
111
|
+
Padding = UDim.new(0, 10),
|
|
112
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
113
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
114
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
pickers,
|
|
118
|
+
}
|
|
117
119
|
end
|
|
118
120
|
|
|
119
121
|
local groups = {}
|
|
120
122
|
local current = {}
|
|
121
|
-
for i=1, #built do
|
|
123
|
+
for i = 1, #built do
|
|
122
124
|
table.insert(current, built[i])
|
|
123
125
|
if #current >= 4 then
|
|
124
126
|
table.insert(groups, pickerGroup(current))
|
|
@@ -131,11 +133,11 @@ function ColorPickerStoryUtils.create(maid, buildPickers)
|
|
|
131
133
|
end
|
|
132
134
|
|
|
133
135
|
return Blend.New "Frame" {
|
|
134
|
-
Size = UDim2.new(0, 0, 0, 0)
|
|
135
|
-
AnchorPoint = Vector2.new(0.5, 0.5)
|
|
136
|
-
Position = UDim2.fromScale(0.5, 0.5)
|
|
137
|
-
BackgroundTransparency = 1
|
|
138
|
-
AutomaticSize = Enum.AutomaticSize.XY
|
|
136
|
+
Size = UDim2.new(0, 0, 0, 0),
|
|
137
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
138
|
+
Position = UDim2.fromScale(0.5, 0.5),
|
|
139
|
+
BackgroundTransparency = 1,
|
|
140
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
139
141
|
|
|
140
142
|
[Blend.OnEvent "InputBegan"] = function(inputObject, processed)
|
|
141
143
|
if processed then
|
|
@@ -145,17 +147,17 @@ function ColorPickerStoryUtils.create(maid, buildPickers)
|
|
|
145
147
|
if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
|
|
146
148
|
currentVisible.Value = nil
|
|
147
149
|
end
|
|
148
|
-
end
|
|
150
|
+
end,
|
|
149
151
|
|
|
150
152
|
Blend.New "UIListLayout" {
|
|
151
|
-
Padding = UDim.new(0, 10)
|
|
152
|
-
HorizontalAlignment = Enum.HorizontalAlignment.Center
|
|
153
|
-
VerticalAlignment = Enum.VerticalAlignment.Top
|
|
154
|
-
FillDirection = Enum.FillDirection.Vertical
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
groups
|
|
158
|
-
}
|
|
153
|
+
Padding = UDim.new(0, 10),
|
|
154
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
155
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
156
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
groups,
|
|
160
|
+
}
|
|
159
161
|
end
|
|
160
162
|
|
|
161
|
-
return ColorPickerStoryUtils
|
|
163
|
+
return ColorPickerStoryUtils
|