@quenty/colorpalette 4.22.0 → 4.23.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,22 @@
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.23.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@4.22.0...@quenty/colorpalette@4.23.0) (2023-05-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Fix unknown font construction in FontPalette ([b14b679](https://github.com/Quenty/NevermoreEngine/commit/b14b6799e0313fda7cd9977be7921d3edaba7fb2))
12
+
13
+
14
+ ### Features
15
+
16
+ * Initial refactor of guis to use ValueObject instead of ValueObject ([723aba0](https://github.com/Quenty/NevermoreEngine/commit/723aba0208cae7e06c9d8bf2d8f0092d042d70ea))
17
+
18
+
19
+
20
+
21
+
6
22
  # [4.22.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@4.21.0...@quenty/colorpalette@4.22.0) (2023-05-08)
7
23
 
8
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/colorpalette",
3
- "version": "4.22.0",
3
+ "version": "4.23.0",
4
4
  "description": "Color palette system for Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -29,16 +29,16 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@quenty/baseobject": "^6.2.1",
32
- "@quenty/blend": "^6.17.0",
33
- "@quenty/color3utils": "^5.18.0",
34
- "@quenty/colorpicker": "^4.19.0",
32
+ "@quenty/blend": "^6.18.0",
33
+ "@quenty/color3utils": "^5.19.0",
34
+ "@quenty/colorpicker": "^4.20.0",
35
35
  "@quenty/loader": "^6.2.1",
36
36
  "@quenty/maid": "^2.5.0",
37
37
  "@quenty/math": "^2.3.0",
38
- "@quenty/rx": "^7.10.0",
39
- "@quenty/signal": "^2.3.0",
38
+ "@quenty/rx": "^7.11.0",
39
+ "@quenty/signal": "^2.4.0",
40
40
  "@quenty/table": "^3.2.0",
41
- "@quenty/valueobject": "^7.13.0"
41
+ "@quenty/valueobject": "^7.14.0"
42
42
  },
43
- "gitHead": "2ad8cea7dd3ad79a39afd7d7b785b489b90553fd"
43
+ "gitHead": "11058e90e51ea83d3dad6ae9abe59cc19c36b94b"
44
44
  }
@@ -315,9 +315,7 @@ function ColorPalette:SetColor(colorName, color)
315
315
  error(("No color grade with name %q"):format(colorName))
316
316
  end
317
317
 
318
- self._colorMaid[colorName] = Blend.mount(self._colorValues[colorName], {
319
- Value = color;
320
- })
318
+ self._colorMaid[colorName] = self._colorValues[colorName]:Mount(color)
321
319
  end
322
320
 
323
321
  function ColorPalette:SetVividness(gradeName, vividness)
@@ -327,21 +325,18 @@ function ColorPalette:SetVividness(gradeName, vividness)
327
325
  error(("No vividness with name %q"):format(gradeName))
328
326
  end
329
327
 
330
- self._vividMaid[gradeName] = Blend.mount(self._vividnessValues[gradeName], {
331
- Value = vividness;
332
- })
328
+ self._vividMaid[gradeName] = self._vividnessValues[gradeName]:Mount(vividness)
333
329
  end
334
330
 
335
331
  function ColorPalette:SetColorGrade(gradeName, grade)
336
332
  assert(type(gradeName) == "string", "Bad colorName")
333
+ assert(grade, "Bad grade")
337
334
 
338
335
  if not self._colorGradeValues[gradeName] then
339
336
  error(("No color grade with name %q"):format(gradeName))
340
337
  end
341
338
 
342
- self._gradeMaid[gradeName] = Blend.mount(self._colorGradeValues[gradeName], {
343
- Value = grade;
344
- })
339
+ self._gradeMaid[gradeName] = self._colorGradeValues[gradeName]:Mount(grade)
345
340
  end
346
341
 
347
342
 
@@ -355,11 +350,11 @@ function ColorPalette:DefineColorGrade(gradeName, gradeValue, vividnessValue)
355
350
  assert(type(gradeName) == "string", "Bad gradeName")
356
351
 
357
352
  if self._colorGradeValues[gradeName] then
358
- warn(("Already defined grade of name %q"):format(gradeName))
353
+ warn(("[ColorPalette.DefineColorGrade] - Already defined grade of name %q"):format(gradeName))
359
354
  return
360
355
  end
361
356
 
362
- local colorGrade = Instance.new("NumberValue")
357
+ local colorGrade = ValueObject.new(0, "number")
363
358
  self._maid:GiveTask(colorGrade)
364
359
 
365
360
  local vividness = ValueObject.new(nil)
@@ -371,7 +366,7 @@ function ColorPalette:DefineColorGrade(gradeName, gradeValue, vividnessValue)
371
366
  self._vividnessValues[gradeName] = vividness
372
367
 
373
368
  self:SetVividness(gradeName, vividnessValue)
374
- self:SetColorGrade(gradeName, gradeValue)
369
+ self:SetColorGrade(gradeName, gradeValue or 0)
375
370
 
376
371
  self.ColorGradeAdded:Fire(gradeName)
377
372
 
@@ -382,12 +377,11 @@ function ColorPalette:DefineColorSwatch(colorName, value)
382
377
  assert(type(colorName) == "string", "Bad colorName")
383
378
 
384
379
  if self._swatches[colorName] then
385
- warn(("Already defined color of name %q"):format(colorName))
380
+ warn(("[ColorPalette.DefineColorGrade] -Already defined color of name %q"):format(colorName))
386
381
  return
387
382
  end
388
383
 
389
- local colorValue = Instance.new("Color3Value")
390
- colorValue.Value = value or Color3.new(0, 0, 0)
384
+ local colorValue = ValueObject.new(value or Color3.new(0, 0, 0), "Color3")
391
385
  self._maid:GiveTask(colorValue)
392
386
 
393
387
  local colorSwatch = ColorSwatch.new(colorValue)
@@ -8,6 +8,7 @@ local Maid = require("Maid")
8
8
  local Blend = require("Blend")
9
9
  local ColorPickerStoryUtils = require("ColorPickerStoryUtils")
10
10
  local ColorPalette = require("ColorPalette")
11
+ local ValueObject = require("ValueObject")
11
12
 
12
13
  local DARK_MODE_ENABLED = false
13
14
 
@@ -61,8 +62,7 @@ return function(target)
61
62
  end
62
63
 
63
64
  local function sampleGui(labelText)
64
- local mouseOver = Instance.new("NumberValue")
65
- mouseOver.Value = 0
65
+ local mouseOver = ValueObject.new(0, "number")
66
66
  maid:GiveTask(mouseOver)
67
67
 
68
68
  local percentMouseOver = Blend.Spring(mouseOver, 60)
@@ -197,9 +197,12 @@ function FontPalette:DefineFont(fontName, defaultFont)
197
197
  end))
198
198
 
199
199
  self._maid:GiveTask(fontValue.Changed:Connect(function(fontEnum)
200
- local font = Font.fromEnum(fontEnum)
201
- local current = fontFaceValue.Value
202
- fontFaceValue.Value = Font.new(font.Family, current.Weight, current.Style)
200
+ -- Assume fontFace is set with something reasonable
201
+ if fontEnum ~= Enum.Font.Unknown then
202
+ local font = Font.fromEnum(fontEnum)
203
+ local current = fontFaceValue.Value
204
+ fontFaceValue.Value = Font.new(font.Family, current.Weight, current.Style)
205
+ end
203
206
  end))
204
207
 
205
208
  self.FontAdded:Fire(fontName)
@@ -53,8 +53,7 @@ return function(target)
53
53
  dark:Add("mouseOver", -15)
54
54
 
55
55
  local function sampleGui(labelText, gradePalette)
56
- local mouseOver = Instance.new("NumberValue")
57
- mouseOver.Value = 0
56
+ local mouseOver = ValueObject.new(0, "number")
58
57
  maid:GiveTask(mouseOver)
59
58
 
60
59
  local percentMouseOver = Blend.Spring(mouseOver, 60)