@quenty/colorpalette 4.34.0 → 4.34.1-canary.417.052e8ba.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
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [4.34.1-canary.417.052e8ba.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@4.34.0...@quenty/colorpalette@4.34.1-canary.417.052e8ba.0) (2023-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* GradePalette can take in Color3 value ([642796d](https://github.com/Quenty/NevermoreEngine/commit/642796d24e23f0691f0ee324e646c89c4396ee6e))
|
|
12
|
+
* Vividness handling for custom colors is more consistent ([539fbee](https://github.com/Quenty/NevermoreEngine/commit/539fbeed18aaaeefaa9772ba9ca4f7fd8084e710))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [4.34.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@4.33.0...@quenty/colorpalette@4.34.0) (2023-09-21)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @quenty/colorpalette
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/colorpalette",
|
|
3
|
-
"version": "4.34.0",
|
|
3
|
+
"version": "4.34.1-canary.417.052e8ba.0",
|
|
4
4
|
"description": "Color palette 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/blend": "
|
|
33
|
-
"@quenty/color3utils": "
|
|
34
|
-
"@quenty/colorpicker": "
|
|
35
|
-
"@quenty/loader": "
|
|
36
|
-
"@quenty/maid": "
|
|
37
|
-
"@quenty/math": "
|
|
38
|
-
"@quenty/rx": "
|
|
39
|
-
"@quenty/signal": "
|
|
40
|
-
"@quenty/table": "
|
|
41
|
-
"@quenty/valueobject": "
|
|
31
|
+
"@quenty/baseobject": "6.3.1-canary.417.052e8ba.0",
|
|
32
|
+
"@quenty/blend": "6.29.1-canary.417.052e8ba.0",
|
|
33
|
+
"@quenty/color3utils": "5.30.1-canary.417.052e8ba.0",
|
|
34
|
+
"@quenty/colorpicker": "4.31.1-canary.417.052e8ba.0",
|
|
35
|
+
"@quenty/loader": "6.3.1-canary.417.052e8ba.0",
|
|
36
|
+
"@quenty/maid": "2.6.0",
|
|
37
|
+
"@quenty/math": "2.5.0",
|
|
38
|
+
"@quenty/rx": "7.16.1-canary.417.052e8ba.0",
|
|
39
|
+
"@quenty/signal": "2.4.1-canary.417.052e8ba.0",
|
|
40
|
+
"@quenty/table": "3.3.0",
|
|
41
|
+
"@quenty/valueobject": "7.24.1-canary.417.052e8ba.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "052e8ba33437f71398c4c08c8dbcbf076022d388"
|
|
44
44
|
}
|
|
@@ -184,7 +184,7 @@ function ColorPalette:_toGradeObservable(grade, fallbackColorSource)
|
|
|
184
184
|
end
|
|
185
185
|
end
|
|
186
186
|
|
|
187
|
-
function ColorPalette:_toVividnessObservable(vividness, grade,
|
|
187
|
+
function ColorPalette:_toVividnessObservable(vividness, grade, colorOrObservable)
|
|
188
188
|
if type(vividness) == "string" then
|
|
189
189
|
return self._gradePalette:ObserveVividness(vividness)
|
|
190
190
|
elseif type(vividness) == "number" then
|
|
@@ -199,25 +199,14 @@ function ColorPalette:_toVividnessObservable(vividness, grade, fallbackColorSour
|
|
|
199
199
|
end
|
|
200
200
|
|
|
201
201
|
if type(grade) == "string" then
|
|
202
|
-
-- Fall back to the grade value
|
|
202
|
+
-- Fall back to the grade value's vividness
|
|
203
203
|
return self._gradePalette:ObserveVividness(grade)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if type(fallbackColorSource) == "string" then
|
|
208
|
-
return (self._gradePalette:ObserveVividness(fallbackColorSource))
|
|
209
|
-
elseif typeof(fallbackColorSource) == "Color3" then
|
|
210
|
-
local luvColor = LuvColor3Utils.fromColor3(fallbackColorSource)
|
|
211
|
-
return Rx.of(luvColor[2])
|
|
212
|
-
elseif Observable.isObservable(fallbackColorSource) then
|
|
213
|
-
return fallbackColorSource:Pipe({
|
|
214
|
-
Rx.map(function(value)
|
|
215
|
-
local luvColor = LuvColor3Utils.fromColor3(value)
|
|
216
|
-
return luvColor[2]
|
|
217
|
-
end)
|
|
218
|
-
})
|
|
204
|
+
elseif type(colorOrObservable) == "string" then
|
|
205
|
+
-- Fall back to color
|
|
206
|
+
return self._gradePalette:ObserveVividness(colorOrObservable)
|
|
219
207
|
else
|
|
220
|
-
|
|
208
|
+
-- Vividness is pretty optional
|
|
209
|
+
return Rx.of(nil)
|
|
221
210
|
end
|
|
222
211
|
end
|
|
223
212
|
|
|
@@ -234,8 +223,8 @@ end
|
|
|
234
223
|
function ColorPalette:_toVividness(vividness, grade, name)
|
|
235
224
|
if type(vividness) == "string" then
|
|
236
225
|
return self._gradePalette:GetVividness(vividness)
|
|
237
|
-
elseif type(
|
|
238
|
-
return
|
|
226
|
+
elseif type(vividness) == "number" then
|
|
227
|
+
return vividness
|
|
239
228
|
elseif type(grade) == "string" then
|
|
240
229
|
-- Fall back to the grade value
|
|
241
230
|
return self._gradePalette:GetVividness(grade)
|
|
@@ -10,7 +10,7 @@ local ColorPickerStoryUtils = require("ColorPickerStoryUtils")
|
|
|
10
10
|
local ColorPalette = require("ColorPalette")
|
|
11
11
|
local ValueObject = require("ValueObject")
|
|
12
12
|
|
|
13
|
-
local DARK_MODE_ENABLED =
|
|
13
|
+
local DARK_MODE_ENABLED = true
|
|
14
14
|
|
|
15
15
|
return function(target)
|
|
16
16
|
local maid = Maid.new()
|
|
@@ -53,12 +53,14 @@ return function(target)
|
|
|
53
53
|
palette:SetColorGrade("highlight", 70, 1)
|
|
54
54
|
palette:SetColorGrade("action", palette:ObserveColorBaseGradeBetween("action", 70, 100), 0.1)
|
|
55
55
|
palette:SetColorGrade("mouseOver", -15)
|
|
56
|
+
palette:SetVividness("text", 0.5)
|
|
57
|
+
palette:SetVividness("action", 0.5)
|
|
56
58
|
end
|
|
57
59
|
|
|
58
60
|
if DARK_MODE_ENABLED then
|
|
59
|
-
light()
|
|
60
|
-
else
|
|
61
61
|
dark()
|
|
62
|
+
else
|
|
63
|
+
light()
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
local function sampleGui(labelText)
|
|
@@ -225,6 +227,12 @@ return function(target)
|
|
|
225
227
|
Blend.New "UIPadding" {
|
|
226
228
|
PaddingTop = UDim.new(0, 10);
|
|
227
229
|
};
|
|
230
|
+
|
|
231
|
+
Blend.New "Frame" {
|
|
232
|
+
Name = "TestCustomColor";
|
|
233
|
+
Size = UDim2.new(0, 30, 0, 30);
|
|
234
|
+
BackgroundColor3 = palette:ObserveColor(Color3.new(0, 0, 1), "text");
|
|
235
|
+
};
|
|
228
236
|
}
|
|
229
237
|
}):Subscribe())
|
|
230
238
|
|
|
@@ -167,7 +167,17 @@ function ColorGradePalette:_observeGradeFromName(gradeName)
|
|
|
167
167
|
if typeof(gradeName) == "Color3" then
|
|
168
168
|
return Rx.of(ColorGradeUtils.getGrade(gradeName))
|
|
169
169
|
elseif Observable.isObservable(gradeName) then
|
|
170
|
-
return gradeName
|
|
170
|
+
return gradeName:Pipe({
|
|
171
|
+
Rx.map(function(value)
|
|
172
|
+
if typeof(value) == "Color3" then
|
|
173
|
+
return ColorGradeUtils.getGrade(value)
|
|
174
|
+
elseif typeof(value) == "number" then
|
|
175
|
+
return value
|
|
176
|
+
else
|
|
177
|
+
error("Bad grade value")
|
|
178
|
+
end
|
|
179
|
+
end)
|
|
180
|
+
})
|
|
171
181
|
end
|
|
172
182
|
|
|
173
183
|
local gradeObservable = self._grades[gradeName]
|