@quenty/colorsequenceutils 7.10.0 → 7.10.1-canary.684.24818543952.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
+ ## [7.10.1-canary.684.24818543952.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorsequenceutils@7.10.0...@quenty/colorsequenceutils@7.10.1-canary.684.24818543952.0) (2026-04-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * Additional improvments ([44896ef](https://github.com/Quenty/NevermoreEngine/commit/44896efe8dd9506ad6002bc41f816b9b2b482ebc))
12
+ * Upgrade dependent libraries with new functionality ([22e8c9e](https://github.com/Quenty/NevermoreEngine/commit/22e8c9e3c3dd7288dd264f00c98852653b40a402))
13
+
14
+
15
+
16
+
17
+
6
18
  # [7.10.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/colorsequenceutils@7.9.3...@quenty/colorsequenceutils@7.10.0) (2026-02-17)
7
19
 
8
20
  **Note:** Version bump only for package @quenty/colorsequenceutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/colorsequenceutils",
3
- "version": "7.10.0",
3
+ "version": "7.10.1-canary.684.24818543952.0",
4
4
  "description": "Utility functions for Color sequences in Roblox.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -31,8 +31,8 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@quenty/loader": "10.10.0",
34
+ "@quenty/loader": "10.10.1-canary.684.24818543952.0",
35
35
  "@quenty/math": "2.7.5"
36
36
  },
37
- "gitHead": "ea9856e1b1ab2c3c1a9c3ed8a07f21a633f59f29"
37
+ "gitHead": "67b6385a1ead1ab1b137158b3e0c179e5f5b19ac"
38
38
  }
@@ -44,6 +44,70 @@ function ColorSequenceUtils.getColor(colorSequence: ColorSequence, t: number): C
44
44
  return keypoints[#keypoints].Value
45
45
  end
46
46
 
47
+ function ColorSequenceUtils.fromUnscaledTimesAndColors(times: { number }, colors: { Color3 }): ColorSequence
48
+ assert(#times == #colors, "Mismatched times and colors")
49
+ local min = math.huge
50
+ local max = -math.huge
51
+ local previous = -math.huge
52
+ for i = 1, #times do
53
+ assert(type(times[i]) == "number", "Bad time")
54
+ assert(typeof(colors[i]) == "Color3", "Bad color")
55
+ assert(times[i] >= previous, "Times must be in ascending order")
56
+ previous = times[i]
57
+
58
+ min = math.min(min, times[i])
59
+ max = math.max(max, times[i])
60
+ end
61
+
62
+ local keypoints: { ColorSequenceKeypoint } = {}
63
+ for i = 1, #times do
64
+ local scaledTime = math.map(times[i], min, max, 0, 1)
65
+ table.insert(keypoints, ColorSequenceKeypoint.new(scaledTime, colors[i]))
66
+ end
67
+
68
+ return ColorSequence.new(keypoints)
69
+ end
70
+
71
+ function ColorSequenceUtils.getSingleColorInSequence(colorSequence: ColorSequence): Color3?
72
+ assert(typeof(colorSequence) == "ColorSequence", "Bad colorSequence")
73
+
74
+ local keypoints = colorSequence.Keypoints
75
+ local firstColor = keypoints[1].Value
76
+ for i = 2, #keypoints do
77
+ if keypoints[i].Value ~= firstColor then
78
+ return nil
79
+ end
80
+ end
81
+
82
+ return firstColor
83
+ end
84
+
85
+ function ColorSequenceUtils.getAverageColor(colorSequence: ColorSequence): Color3
86
+ assert(typeof(colorSequence) == "ColorSequence", "Bad colorSequence")
87
+ local keypoints = colorSequence.Keypoints
88
+ assert(#keypoints > 0, "Color sequence must have at least one keypoint")
89
+
90
+ if #keypoints == 1 then
91
+ return keypoints[1].Value
92
+ end
93
+
94
+ local totalR = 0
95
+ local totalG = 0
96
+ local totalB = 0
97
+
98
+ for i = 2, #keypoints do
99
+ local prev = keypoints[i - 1]
100
+ local curr = keypoints[i]
101
+ local dt = curr.Time - prev.Time
102
+
103
+ totalR = totalR + (prev.Value.R + curr.Value.R) * 0.5 * dt
104
+ totalG = totalG + (prev.Value.G + curr.Value.G) * 0.5 * dt
105
+ totalB = totalB + (prev.Value.B + curr.Value.B) * 0.5 * dt
106
+ end
107
+
108
+ return Color3.new(totalR, totalG, totalB)
109
+ end
110
+
47
111
  --[=[
48
112
  Makes stripes for color sequences.
49
113