@woosh/meep-engine 2.118.7 → 2.118.8

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.
@@ -54449,7 +54449,7 @@ class Color {
54449
54449
  return output;
54450
54450
  }
54451
54451
  }
54452
- ex;
54452
+
54453
54453
  /**
54454
54454
  * @deprecated use {@link Color#toArray} instead
54455
54455
  * @readonly
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.118.7",
8
+ "version": "2.118.8",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -700,7 +700,7 @@ export class Color {
700
700
  return output;
701
701
  }
702
702
  }
703
- ex
703
+
704
704
  /**
705
705
  * @deprecated use {@link Color#toArray} instead
706
706
  * @readonly
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param {Color} input
4
+ * @param {number} [amount]
5
+ */
6
+ export function color_darken(input: Color, amount?: number): Color;
7
+ import { Color } from "../Color.js";
8
+ //# sourceMappingURL=color_darken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_darken.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_darken.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,oCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
@@ -0,0 +1,27 @@
1
+ import { assert } from "../../assert.js";
2
+ import { clamp01 } from "../../math/clamp01.js";
3
+ import { Color } from "../Color.js";
4
+ import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
5
+ import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
6
+
7
+ const hsv = [0, 0, 0];
8
+
9
+ /**
10
+ *
11
+ * @param {Color} input
12
+ * @param {number} [amount]
13
+ */
14
+ export function color_darken(input, amount = 1) {
15
+ assert.isNumber(amount, 'amount');
16
+ assert.greaterThanOrEqual(amount, 0, 'amount');
17
+
18
+ const r = new Color();
19
+
20
+ linear_srgb_to_okhsv(hsv, input.r, input.g, input.b);
21
+
22
+ hsv[2] = clamp01(hsv[2] * (1 - amount));
23
+
24
+ okhsv_to_linear_srgb(r, ...hsv);
25
+
26
+ return r;
27
+ }
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  *
3
3
  * @param {Color} input
4
- * @param {number} amount
4
+ * @param {number} [amount]
5
5
  */
6
- export function color_desaturate(input: Color, amount: number): any;
6
+ export function color_desaturate(input: Color, amount?: number): Color;
7
+ import { Color } from "../Color.js";
7
8
  //# sourceMappingURL=color_desaturate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color_desaturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_desaturate.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,uDAFW,MAAM,OAUhB"}
1
+ {"version":3,"file":"color_desaturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_desaturate.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
@@ -1,16 +1,27 @@
1
+ import { assert } from "../../assert.js";
1
2
  import { clamp01 } from "../../math/clamp01.js";
3
+ import { Color } from "../Color.js";
4
+ import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
5
+ import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
6
+
7
+ const hsv = [0, 0, 0];
2
8
 
3
9
  /**
4
10
  *
5
11
  * @param {Color} input
6
- * @param {number} amount
12
+ * @param {number} [amount]
7
13
  */
8
- export function color_desaturate(input, amount) {
9
- const r = input.clone();
14
+ export function color_desaturate(input, amount=1) {
15
+ assert.isNumber(amount,'amount');
16
+ assert.greaterThanOrEqual(amount,0,'amount');
17
+
18
+ const r = new Color();
19
+
20
+ linear_srgb_to_okhsv(hsv, input.r, input.g, input.b);
10
21
 
11
- const hsv = r.getHSV();
22
+ hsv[1] = clamp01(hsv[1] * (1 - amount));
12
23
 
13
- r.setHSV(hsv.h, hsv.s * clamp01(1 - amount), hsv.v);
24
+ okhsv_to_linear_srgb(r, ...hsv);
14
25
 
15
26
  return r;
16
27
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param {Color} input
4
+ * @param {number} amount
5
+ */
6
+ export function color_lighten(input: Color, amount?: number): Color;
7
+ import { Color } from "../Color.js";
8
+ //# sourceMappingURL=color_lighten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_lighten.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_lighten.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,qCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
@@ -0,0 +1,27 @@
1
+ import { assert } from "../../assert.js";
2
+ import { clamp01 } from "../../math/clamp01.js";
3
+ import { Color } from "../Color.js";
4
+ import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
5
+ import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
6
+
7
+ const hsv = [0, 0, 0];
8
+
9
+ /**
10
+ *
11
+ * @param {Color} input
12
+ * @param {number} amount
13
+ */
14
+ export function color_lighten(input, amount = 1) {
15
+ assert.isNumber(amount, 'amount');
16
+ assert.greaterThanOrEqual(amount, 0, 'amount');
17
+
18
+ const r = new Color();
19
+
20
+ linear_srgb_to_okhsv(hsv, input.r, input.g, input.b);
21
+
22
+ hsv[2] = clamp01(hsv[2] * (1 + amount));
23
+
24
+ okhsv_to_linear_srgb(r, ...hsv);
25
+
26
+ return r;
27
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param {Color} input
4
+ * @param {number} [amount]
5
+ */
6
+ export function color_saturate(input: Color, amount?: number): Color;
7
+ import { Color } from "../Color.js";
8
+ //# sourceMappingURL=color_saturate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_saturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_saturate.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,sCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
@@ -0,0 +1,27 @@
1
+ import { assert } from "../../assert.js";
2
+ import { clamp01 } from "../../math/clamp01.js";
3
+ import { Color } from "../Color.js";
4
+ import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
5
+ import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
6
+
7
+ const hsv = [0,0,0];
8
+
9
+ /**
10
+ *
11
+ * @param {Color} input
12
+ * @param {number} [amount]
13
+ */
14
+ export function color_saturate(input, amount=1) {
15
+ assert.isNumber(amount,'amount');
16
+ assert.greaterThanOrEqual(amount,0,'amount');
17
+
18
+ const r = new Color();
19
+
20
+ linear_srgb_to_okhsv(hsv, input.r,input.g, input.b);
21
+
22
+ hsv[1] = clamp01(hsv[1] * (1 + amount));
23
+
24
+ okhsv_to_linear_srgb(r, ...hsv);
25
+
26
+ return r;
27
+ }