@quenty/colorpalette 10.21.3-canary.550.afa1b3b.0 → 10.21.4-canary.11a5dcf.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 +17 -1
- package/package.json +13 -13
- package/src/Shared/ColorPalette.lua +84 -61
- package/src/Shared/ColorPalette.story.lua +125 -116
- package/src/Shared/Font/FontPalette.lua +47 -28
- package/src/Shared/Grade/ColorGradePalette.lua +30 -21
- package/src/Shared/Grade/ColorGradePalette.story.lua +118 -107
- package/src/Shared/Grade/ColorGradeUtils.lua +3 -3
- package/src/Shared/Swatch/ColorSwatch.lua +38 -27
- package/src/Shared/Swatch/ColorSwatch.story.lua +57 -55
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,23 @@
|
|
|
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.21.
|
|
6
|
+
## [10.21.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@10.21.3...@quenty/colorpalette@10.21.4-canary.11a5dcf.0) (2025-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [10.21.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@10.21.2...@quenty/colorpalette@10.21.3) (2025-04-10)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @quenty/colorpalette
|
|
9
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/colorpalette",
|
|
3
|
-
"version": "10.21.
|
|
3
|
+
"version": "10.21.4-canary.11a5dcf.0",
|
|
4
4
|
"description": "Color palette system for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@quenty/baseobject": "10.8.
|
|
32
|
-
"@quenty/blend": "12.18.
|
|
33
|
-
"@quenty/color3utils": "11.18.
|
|
34
|
-
"@quenty/colorpicker": "10.19.
|
|
35
|
-
"@quenty/loader": "10.8.
|
|
36
|
-
"@quenty/maid": "3.4.
|
|
31
|
+
"@quenty/baseobject": "10.8.4-canary.11a5dcf.0",
|
|
32
|
+
"@quenty/blend": "12.18.4-canary.11a5dcf.0",
|
|
33
|
+
"@quenty/color3utils": "11.18.4-canary.11a5dcf.0",
|
|
34
|
+
"@quenty/colorpicker": "10.19.4-canary.11a5dcf.0",
|
|
35
|
+
"@quenty/loader": "10.8.4-canary.11a5dcf.0",
|
|
36
|
+
"@quenty/maid": "3.4.4-canary.11a5dcf.0",
|
|
37
37
|
"@quenty/math": "2.7.3",
|
|
38
|
-
"@quenty/observablecollection": "12.20.
|
|
39
|
-
"@quenty/rx": "13.17.
|
|
40
|
-
"@quenty/signal": "7.10.
|
|
41
|
-
"@quenty/table": "3.7.
|
|
42
|
-
"@quenty/valueobject": "13.17.
|
|
38
|
+
"@quenty/observablecollection": "12.20.4-canary.11a5dcf.0",
|
|
39
|
+
"@quenty/rx": "13.17.4-canary.11a5dcf.0",
|
|
40
|
+
"@quenty/signal": "7.10.4-canary.11a5dcf.0",
|
|
41
|
+
"@quenty/table": "3.7.5-canary.11a5dcf.0",
|
|
42
|
+
"@quenty/valueobject": "13.17.4-canary.11a5dcf.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
|
|
45
45
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
@class ColorPalette
|
|
3
4
|
]=]
|
|
@@ -5,22 +6,39 @@
|
|
|
5
6
|
local require = require(script.Parent.loader).load(script)
|
|
6
7
|
|
|
7
8
|
local BaseObject = require("BaseObject")
|
|
8
|
-
local ValueObject = require("ValueObject")
|
|
9
|
-
local ColorSwatch = require("ColorSwatch")
|
|
10
|
-
local ColorGradePalette = require("ColorGradePalette")
|
|
11
|
-
local Rx = require("Rx")
|
|
12
9
|
local Blend = require("Blend")
|
|
13
|
-
local
|
|
10
|
+
local Brio = require("Brio")
|
|
11
|
+
local ColorGradePalette = require("ColorGradePalette")
|
|
14
12
|
local ColorGradeUtils = require("ColorGradeUtils")
|
|
13
|
+
local ColorSwatch = require("ColorSwatch")
|
|
15
14
|
local LuvColor3Utils = require("LuvColor3Utils")
|
|
15
|
+
local Observable = require("Observable")
|
|
16
16
|
local ObservableMap = require("ObservableMap")
|
|
17
|
+
local Rx = require("Rx")
|
|
18
|
+
local Signal = require("Signal")
|
|
19
|
+
local ValueObject = require("ValueObject")
|
|
17
20
|
|
|
18
21
|
local ColorPalette = setmetatable({}, BaseObject)
|
|
19
22
|
ColorPalette.ClassName = "ColorPalette"
|
|
20
23
|
ColorPalette.__index = ColorPalette
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
export type ColorPalette = typeof(setmetatable(
|
|
26
|
+
{} :: {
|
|
27
|
+
_swatches: { ColorSwatch.ColorSwatch },
|
|
28
|
+
_gradePalette: ColorGradePalette.ColorGradePalette,
|
|
29
|
+
_swatchMap: any,
|
|
30
|
+
_colorGradeMap: any,
|
|
31
|
+
_colorValues: { [string]: ValueObject.ValueObject<Color3> },
|
|
32
|
+
_vividnessValues: { [string]: ValueObject.ValueObject<number> },
|
|
33
|
+
|
|
34
|
+
ColorSwatchAdded: Signal.Signal<string>,
|
|
35
|
+
ColorGradeAdded: Signal.Signal<string>,
|
|
36
|
+
},
|
|
37
|
+
{} :: typeof({ __index = ColorPalette })
|
|
38
|
+
)) & BaseObject.BaseObject
|
|
39
|
+
|
|
40
|
+
function ColorPalette.new(): ColorPalette
|
|
41
|
+
local self: ColorPalette = setmetatable(BaseObject.new() :: any, ColorPalette)
|
|
24
42
|
|
|
25
43
|
self._gradePalette = self._maid:Add(ColorGradePalette.new())
|
|
26
44
|
|
|
@@ -30,78 +48,84 @@ function ColorPalette.new()
|
|
|
30
48
|
self._vividnessValues = {}
|
|
31
49
|
|
|
32
50
|
self.ColorSwatchAdded = assert(self._swatchMap.KeyAdded, "No KeyAdded") -- :Fire(name)
|
|
33
|
-
self.ColorGradeAdded = assert(self._colorGradeMap.KeyAdded, "No KeyAdded") -- :Fire(name)
|
|
51
|
+
self.ColorGradeAdded = assert(self._colorGradeMap.KeyAdded, "No KeyAdded") -- :Fire(name)
|
|
34
52
|
|
|
35
53
|
return self
|
|
36
54
|
end
|
|
37
55
|
|
|
38
|
-
function ColorPalette
|
|
56
|
+
function ColorPalette.GetSwatchNames(self: ColorPalette): { string }
|
|
39
57
|
return self._swatchMap:GetKeyList()
|
|
40
58
|
end
|
|
41
59
|
|
|
42
|
-
function ColorPalette
|
|
43
|
-
return Rx.fromSignal(self.ColorSwatchAdded):Pipe({
|
|
60
|
+
function ColorPalette.ObserveSwatchNames(self: ColorPalette): Observable.Observable<{ string }>
|
|
61
|
+
return Rx.fromSignal(self.ColorSwatchAdded :: any):Pipe({
|
|
44
62
|
Rx.startFrom(function()
|
|
45
63
|
return self:GetSwatchNames()
|
|
46
|
-
end)
|
|
47
|
-
})
|
|
64
|
+
end) :: any,
|
|
65
|
+
}) :: any
|
|
48
66
|
end
|
|
49
67
|
|
|
50
|
-
function ColorPalette
|
|
68
|
+
function ColorPalette.ObserveSwatchNameList(self: ColorPalette): Observable.Observable<{ string }>
|
|
51
69
|
return self._swatchMap:ObserveKeyList()
|
|
52
70
|
end
|
|
53
71
|
|
|
54
|
-
function ColorPalette
|
|
72
|
+
function ColorPalette.ObserveSwatchNamesBrio(self: ColorPalette)
|
|
55
73
|
return self._swatchMap:ObserveKeysBrio()
|
|
56
74
|
end
|
|
57
75
|
|
|
58
|
-
function ColorPalette
|
|
76
|
+
function ColorPalette.GetGradeNames(self: ColorPalette): { string }
|
|
59
77
|
return self._colorGradeMap:GetKeyList()
|
|
60
78
|
end
|
|
61
79
|
|
|
62
|
-
function ColorPalette
|
|
80
|
+
function ColorPalette.ObserveGradeNameList(self: ColorPalette)
|
|
63
81
|
return self._colorGradeMap:ObserveKeyList()
|
|
64
82
|
end
|
|
65
83
|
|
|
66
|
-
function ColorPalette
|
|
67
|
-
return Rx.fromSignal(self.ColorGradeAdded):Pipe({
|
|
84
|
+
function ColorPalette.ObserveGradeNames(self: ColorPalette): Observable.Observable<{ string }>
|
|
85
|
+
return Rx.fromSignal(self.ColorGradeAdded :: any):Pipe({
|
|
68
86
|
Rx.startFrom(function()
|
|
69
87
|
return self:GetGradeNames()
|
|
70
|
-
end)
|
|
71
|
-
})
|
|
88
|
+
end) :: any,
|
|
89
|
+
}) :: any
|
|
72
90
|
end
|
|
73
91
|
|
|
74
|
-
function ColorPalette
|
|
92
|
+
function ColorPalette.ObserveGradeNamesBrio(self: ColorPalette): Observable.Observable<Brio.Brio<string>>
|
|
75
93
|
return self._colorGradeMap:ObserveKeysBrio()
|
|
76
94
|
end
|
|
77
95
|
|
|
78
|
-
function ColorPalette
|
|
96
|
+
function ColorPalette.GetColorValues(self: ColorPalette)
|
|
79
97
|
return self._colorValues
|
|
80
98
|
end
|
|
81
99
|
|
|
82
|
-
function ColorPalette
|
|
100
|
+
function ColorPalette.GetColor(self: ColorPalette, color, grade, vividness)
|
|
83
101
|
if type(color) == "string" then
|
|
84
|
-
return self:GetColorSwatch(color)
|
|
85
|
-
self:_toGrade(grade, color),
|
|
86
|
-
self:_toVividness(vividness, grade, color))
|
|
102
|
+
return self:GetColorSwatch(color)
|
|
103
|
+
:GetGraded(self:_toGrade(grade, color), self:_toVividness(vividness, grade, color))
|
|
87
104
|
elseif typeof(color) == "Color3" then
|
|
88
|
-
return ColorGradeUtils.getGradedColor(
|
|
105
|
+
return ColorGradeUtils.getGradedColor(
|
|
106
|
+
color,
|
|
107
|
+
self:_toGrade(grade, color),
|
|
108
|
+
self:_toVividness(vividness, grade, color)
|
|
109
|
+
)
|
|
89
110
|
elseif typeof(color) == "Instance" and color:IsA("Color3Value") then
|
|
90
|
-
return ColorGradeUtils.getGradedColor(
|
|
111
|
+
return ColorGradeUtils.getGradedColor(
|
|
112
|
+
color.Value,
|
|
91
113
|
self:_toGrade(grade, color),
|
|
92
|
-
self:_toVividness(vividness, grade, color)
|
|
114
|
+
self:_toVividness(vividness, grade, color)
|
|
115
|
+
)
|
|
93
116
|
else
|
|
94
117
|
error("Bad color")
|
|
95
118
|
end
|
|
96
119
|
end
|
|
97
120
|
|
|
98
|
-
function ColorPalette
|
|
121
|
+
function ColorPalette.ObserveColor(self: ColorPalette, color, grade, vividness): Observable.Observable<Color3>
|
|
99
122
|
-- assert(type(color) == "string", "Bad color")
|
|
100
123
|
|
|
101
124
|
if type(color) == "string" then
|
|
102
125
|
return self:GetColorSwatch(color):ObserveGraded(
|
|
103
126
|
self:_toGradeObservable(grade, color),
|
|
104
|
-
self:_toVividnessObservable(vividness, grade, color)
|
|
127
|
+
self:_toVividnessObservable(vividness, grade, color)
|
|
128
|
+
)
|
|
105
129
|
end
|
|
106
130
|
|
|
107
131
|
-- handle observable of color. this is for custom colors.
|
|
@@ -116,31 +140,31 @@ function ColorPalette:ObserveColor(color, grade, vividness)
|
|
|
116
140
|
if colorOrObservable then
|
|
117
141
|
if grade == nil and vividness == nil then
|
|
118
142
|
-- no modification needed
|
|
119
|
-
return colorOrObservable
|
|
143
|
+
return colorOrObservable :: any
|
|
120
144
|
end
|
|
121
145
|
|
|
122
146
|
-- TODO: Optimize this potentially
|
|
123
147
|
return Rx.combineLatest({
|
|
124
|
-
baseColor = colorOrObservable
|
|
125
|
-
colorGrade = self:_toGradeObservable(grade, colorOrObservable)
|
|
126
|
-
vividness = self:_toVividnessObservable(vividness, grade, colorOrObservable)
|
|
148
|
+
baseColor = colorOrObservable,
|
|
149
|
+
colorGrade = self:_toGradeObservable(grade, colorOrObservable),
|
|
150
|
+
vividness = self:_toVividnessObservable(vividness, grade, colorOrObservable),
|
|
127
151
|
}):Pipe({
|
|
128
152
|
Rx.map(function(state)
|
|
129
153
|
return ColorGradeUtils.getGradedColor(state.baseColor, state.colorGrade, state.vividness)
|
|
130
|
-
end)
|
|
131
|
-
})
|
|
154
|
+
end) :: any,
|
|
155
|
+
}) :: any
|
|
132
156
|
else
|
|
133
157
|
error("Bad color")
|
|
134
158
|
end
|
|
135
159
|
end
|
|
136
160
|
|
|
137
|
-
function ColorPalette
|
|
161
|
+
function ColorPalette.SetDefaultSurfaceName(self: ColorPalette, surfaceName: string)
|
|
138
162
|
assert(type(surfaceName) == "string", "Bad surfaceName")
|
|
139
163
|
|
|
140
164
|
self._gradePalette:SetDefaultSurfaceName(surfaceName)
|
|
141
165
|
end
|
|
142
166
|
|
|
143
|
-
function ColorPalette
|
|
167
|
+
function ColorPalette.GetColorSwatch(self: ColorPalette, colorName: string)
|
|
144
168
|
local swatch = self._swatchMap:Get(colorName)
|
|
145
169
|
if not swatch then
|
|
146
170
|
error(string.format("No swatch with name %q", colorName))
|
|
@@ -149,11 +173,11 @@ function ColorPalette:GetColorSwatch(colorName)
|
|
|
149
173
|
return swatch
|
|
150
174
|
end
|
|
151
175
|
|
|
152
|
-
function ColorPalette
|
|
176
|
+
function ColorPalette.ObserveGradeOn(self: ColorPalette, colorName: string, newSurfaceName, baseSurfaceName)
|
|
153
177
|
return self._gradePalette:ObserveOn(colorName, newSurfaceName, baseSurfaceName)
|
|
154
178
|
end
|
|
155
179
|
|
|
156
|
-
function ColorPalette
|
|
180
|
+
function ColorPalette._toGradeObservable(self: ColorPalette, grade, fallbackColorSource)
|
|
157
181
|
if type(grade) == "string" then
|
|
158
182
|
return (self._gradePalette:ObserveGrade(grade))
|
|
159
183
|
elseif type(grade) == "number" then
|
|
@@ -185,7 +209,7 @@ function ColorPalette:_toGradeObservable(grade, fallbackColorSource)
|
|
|
185
209
|
end
|
|
186
210
|
end
|
|
187
211
|
|
|
188
|
-
function ColorPalette
|
|
212
|
+
function ColorPalette._toVividnessObservable(self: ColorPalette, vividness, grade, colorOrObservable)
|
|
189
213
|
if type(vividness) == "string" then
|
|
190
214
|
return self._gradePalette:ObserveVividness(vividness)
|
|
191
215
|
elseif type(vividness) == "number" then
|
|
@@ -211,7 +235,7 @@ function ColorPalette:_toVividnessObservable(vividness, grade, colorOrObservable
|
|
|
211
235
|
end
|
|
212
236
|
end
|
|
213
237
|
|
|
214
|
-
function ColorPalette
|
|
238
|
+
function ColorPalette._toGrade(self: ColorPalette, grade, name): number
|
|
215
239
|
if type(grade) == "string" then
|
|
216
240
|
return self._gradePalette:GetGrade(grade)
|
|
217
241
|
elseif type(grade) == "number" then
|
|
@@ -221,7 +245,7 @@ function ColorPalette:_toGrade(grade, name)
|
|
|
221
245
|
end
|
|
222
246
|
end
|
|
223
247
|
|
|
224
|
-
function ColorPalette
|
|
248
|
+
function ColorPalette._toVividness(self: ColorPalette, vividness, grade, name): number
|
|
225
249
|
if type(vividness) == "string" then
|
|
226
250
|
return self._gradePalette:GetVividness(vividness)
|
|
227
251
|
elseif type(vividness) == "number" then
|
|
@@ -235,7 +259,7 @@ function ColorPalette:_toVividness(vividness, grade, name)
|
|
|
235
259
|
end
|
|
236
260
|
end
|
|
237
261
|
|
|
238
|
-
function ColorPalette
|
|
262
|
+
function ColorPalette.GetColorValue(self: ColorPalette, colorName: string)
|
|
239
263
|
assert(type(colorName) == "string", "Bad colorName")
|
|
240
264
|
|
|
241
265
|
local colorValue = self._colorValues[colorName]
|
|
@@ -246,7 +270,7 @@ function ColorPalette:GetColorValue(colorName: string)
|
|
|
246
270
|
return colorValue
|
|
247
271
|
end
|
|
248
272
|
|
|
249
|
-
function ColorPalette
|
|
273
|
+
function ColorPalette.GetGradeValue(self: ColorPalette, gradeName: string): ValueObject.ValueObject<number>
|
|
250
274
|
local gradeValue = self._colorGradeMap:Get(gradeName)
|
|
251
275
|
if not gradeValue then
|
|
252
276
|
error(string.format("No grade with name %q", gradeName))
|
|
@@ -255,7 +279,7 @@ function ColorPalette:GetGradeValue(gradeName)
|
|
|
255
279
|
return gradeValue
|
|
256
280
|
end
|
|
257
281
|
|
|
258
|
-
function ColorPalette
|
|
282
|
+
function ColorPalette.GetVividnessValue(self: ColorPalette, gradeName: string): ValueObject.ValueObject<number>
|
|
259
283
|
local vividnessValue = self._vividnessValues[gradeName]
|
|
260
284
|
if not vividnessValue then
|
|
261
285
|
error(string.format("No grade with name %q", gradeName))
|
|
@@ -264,19 +288,19 @@ function ColorPalette:GetVividnessValue(gradeName)
|
|
|
264
288
|
return vividnessValue
|
|
265
289
|
end
|
|
266
290
|
|
|
267
|
-
function ColorPalette
|
|
291
|
+
function ColorPalette.ObserveModifiedGrade(self: ColorPalette, gradeName, amount, multiplier)
|
|
268
292
|
return self._gradePalette:ObserveModified(gradeName, amount, multiplier)
|
|
269
293
|
end
|
|
270
294
|
|
|
271
|
-
function ColorPalette
|
|
295
|
+
function ColorPalette.ObserveGrade(self: ColorPalette, name)
|
|
272
296
|
return self._gradePalette:ObserveGrade(name)
|
|
273
297
|
end
|
|
274
298
|
|
|
275
|
-
function ColorPalette
|
|
299
|
+
function ColorPalette.ObserveVividness(self: ColorPalette, name)
|
|
276
300
|
return self._gradePalette:ObserveVividness(name)
|
|
277
301
|
end
|
|
278
302
|
|
|
279
|
-
function ColorPalette
|
|
303
|
+
function ColorPalette.GetSwatch(self: ColorPalette, swatchName: string)
|
|
280
304
|
assert(type(swatchName) == "string", "Bad swatchName")
|
|
281
305
|
|
|
282
306
|
local swatch = self._swatchMap:Get(swatchName)
|
|
@@ -291,7 +315,7 @@ end
|
|
|
291
315
|
@param colorName string
|
|
292
316
|
@param color Observable<Color3> | Color3
|
|
293
317
|
]=]
|
|
294
|
-
function ColorPalette
|
|
318
|
+
function ColorPalette.SetColor(self: ColorPalette, colorName, color)
|
|
295
319
|
assert(type(colorName) == "string", "Bad colorName")
|
|
296
320
|
|
|
297
321
|
if not self._colorValues[colorName] then
|
|
@@ -301,7 +325,7 @@ function ColorPalette:SetColor(colorName, color)
|
|
|
301
325
|
return self._colorValues[colorName]:Mount(color)
|
|
302
326
|
end
|
|
303
327
|
|
|
304
|
-
function ColorPalette
|
|
328
|
+
function ColorPalette.SetVividness(self: ColorPalette, gradeName, vividness)
|
|
305
329
|
assert(type(gradeName) == "string", "Bad colorName")
|
|
306
330
|
|
|
307
331
|
if not self._vividnessValues[gradeName] then
|
|
@@ -311,7 +335,7 @@ function ColorPalette:SetVividness(gradeName, vividness)
|
|
|
311
335
|
return self._vividnessValues[gradeName]:Mount(vividness)
|
|
312
336
|
end
|
|
313
337
|
|
|
314
|
-
function ColorPalette
|
|
338
|
+
function ColorPalette.SetColorGrade(self: ColorPalette, gradeName, grade)
|
|
315
339
|
assert(type(gradeName) == "string", "Bad colorName")
|
|
316
340
|
assert(grade, "Bad grade")
|
|
317
341
|
|
|
@@ -323,14 +347,13 @@ function ColorPalette:SetColorGrade(gradeName, grade)
|
|
|
323
347
|
return gradeValue:Mount(grade)
|
|
324
348
|
end
|
|
325
349
|
|
|
326
|
-
|
|
327
|
-
function ColorPalette:ObserveColorBaseGradeBetween(colorName, low, high)
|
|
350
|
+
function ColorPalette.ObserveColorBaseGradeBetween(self: ColorPalette, colorName, low, high)
|
|
328
351
|
assert(type(colorName) == "string", "Bad colorName")
|
|
329
352
|
|
|
330
353
|
return self:GetSwatch(colorName):ObserveBaseGradeBetween(low, high)
|
|
331
354
|
end
|
|
332
355
|
|
|
333
|
-
function ColorPalette
|
|
356
|
+
function ColorPalette.DefineColorGrade(self: ColorPalette, gradeName, gradeValue, vividnessValue)
|
|
334
357
|
assert(type(gradeName) == "string", "Bad gradeName")
|
|
335
358
|
|
|
336
359
|
if self._colorGradeMap:Get(gradeName) then
|
|
@@ -352,7 +375,7 @@ function ColorPalette:DefineColorGrade(gradeName, gradeValue, vividnessValue)
|
|
|
352
375
|
return colorGrade
|
|
353
376
|
end
|
|
354
377
|
|
|
355
|
-
function ColorPalette
|
|
378
|
+
function ColorPalette.DefineColorSwatch(self: ColorPalette, colorName, value)
|
|
356
379
|
assert(type(colorName) == "string", "Bad colorName")
|
|
357
380
|
|
|
358
381
|
if self._swatchMap:Get(colorName) then
|
|
@@ -361,7 +384,7 @@ function ColorPalette:DefineColorSwatch(colorName, value)
|
|
|
361
384
|
end
|
|
362
385
|
|
|
363
386
|
local colorValue = self._maid:Add(ValueObject.new(value or Color3.new(0, 0, 0), "Color3"))
|
|
364
|
-
local colorSwatch = self._maid:Add(ColorSwatch.new(colorValue))
|
|
387
|
+
local colorSwatch = self._maid:Add(ColorSwatch.new(colorValue :: any))
|
|
365
388
|
|
|
366
389
|
self._colorValues[colorName] = colorValue
|
|
367
390
|
|
|
@@ -370,4 +393,4 @@ function ColorPalette:DefineColorSwatch(colorName, value)
|
|
|
370
393
|
return colorSwatch
|
|
371
394
|
end
|
|
372
395
|
|
|
373
|
-
return ColorPalette
|
|
396
|
+
return ColorPalette
|