@quenty/colorpalette 4.4.0 → 4.5.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,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
+ # [4.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@4.4.0...@quenty/colorpalette@4.5.0) (2022-11-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * ColorGradePallete allows grades to be observed from a custom Color3 value ([d80bcd0](https://github.com/Quenty/NevermoreEngine/commit/d80bcd0af2e745a4881bdb02cd96443423cda59c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [4.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorpalette@4.3.1...@quenty/colorpalette@4.4.0) (2022-11-08)
7
18
 
8
19
  **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.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "Color palette system for Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@quenty/baseobject": "^6.0.1",
32
- "@quenty/blend": "^6.3.1",
33
- "@quenty/color3utils": "^5.3.1",
34
- "@quenty/colorpicker": "^4.4.0",
32
+ "@quenty/blend": "^6.4.0",
33
+ "@quenty/color3utils": "^5.4.0",
34
+ "@quenty/colorpicker": "^4.5.0",
35
35
  "@quenty/loader": "^6.0.1",
36
36
  "@quenty/maid": "^2.4.0",
37
37
  "@quenty/math": "^2.2.0",
@@ -40,5 +40,5 @@
40
40
  "@quenty/table": "^3.1.0",
41
41
  "@quenty/valueobject": "^7.1.1"
42
42
  },
43
- "gitHead": "3432599d8ed7bf7f0436d7cd5495925543450117"
43
+ "gitHead": "2114f42ae399a4417a3ebd4d35bf481690ca7923"
44
44
  }
@@ -122,6 +122,8 @@ function ColorGradePalette:ObserveModified(gradeName, amount, multiplier)
122
122
  Rx.map(function(state)
123
123
  assert(type(state.grade) == "number", "Bad state.grade")
124
124
  assert(type(state.amount) == "number", "Bad state.amount")
125
+ assert(type(state.multiplier) == "number", "Bad state.multiplier")
126
+
125
127
  return state.grade + state.multiplier*state.amount
126
128
  end);
127
129
  })
@@ -169,11 +171,19 @@ function ColorGradePalette:_observeGradeFromName(gradeName)
169
171
  end
170
172
 
171
173
  local gradeObservable = self._grades[gradeName]
172
- if not gradeObservable then
173
- error(("No grade for gradeName %q"):format(tostring(gradeName)))
174
+ if gradeObservable then
175
+ return gradeObservable
176
+ end
177
+
178
+ -- Support custom colors passed in here
179
+ local colorOrObservable = Blend.toPropertyObservable(gradeName)
180
+ if colorOrObservable then
181
+ return colorOrObservable:Pipe({
182
+ Rx.map(ColorGradeUtils.getGrade)
183
+ })
174
184
  end
175
185
 
176
- return gradeObservable
186
+ error(("No grade for gradeName %q"):format(tostring(gradeName)))
177
187
  end
178
188
 
179
189
  function ColorGradePalette:ObserveDefaultSurfaceGrade()