@quenty/color3utils 5.5.1 → 5.6.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
+ # [5.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/color3utils@5.5.1...@quenty/color3utils@5.6.0) (2022-12-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add Color3Utils.areEqual(a, b, epsilon) ([3943a7f](https://github.com/Quenty/NevermoreEngine/commit/3943a7fe2cc581ae85fa5eb2fc14bf146012dde3))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [5.5.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/color3utils@5.5.0...@quenty/color3utils@5.5.1) (2022-12-27)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/color3utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/color3utils",
3
- "version": "5.5.1",
3
+ "version": "5.6.0",
4
4
  "description": "Utility methods for Roblox Color3 values",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -34,5 +34,5 @@
34
34
  "@quenty/rx": "^7.2.1",
35
35
  "@quenty/valueobject": "^7.2.1"
36
36
  },
37
- "gitHead": "ff0c0732eca3400949945c58c1d3cb8a479c9789"
37
+ "gitHead": "daae02817ae9128c5bf81220ef44e41d22ec14ad"
38
38
  }
@@ -97,4 +97,22 @@ function Color3Utils.setSaturation(color3, saturation)
97
97
  return Color3.fromHSV(h, saturation, v)
98
98
  end
99
99
 
100
+ --[=[
101
+ Compares 2 color3 values
102
+
103
+ @param a Color3
104
+ @param b Color3
105
+ @param epsilon number? -- Optional
106
+ @return boolean
107
+ ]=]
108
+ function Color3Utils.areEqual(a, b, epsilon)
109
+ if not epsilon then
110
+ epsilon = 1e-6
111
+ end
112
+
113
+ return math.abs(a.r - b.r) <= epsilon
114
+ and math.abs(a.g - b.g) <= epsilon
115
+ and math.abs(a.b - b.b) <= epsilon
116
+ end
117
+
100
118
  return Color3Utils