@woosh/meep-engine 2.118.6 → 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.
- package/build/meep.cjs +12 -5
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +12 -5
- package/package.json +1 -1
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +11 -4
- package/src/core/color/operations/color_darken.d.ts +8 -0
- package/src/core/color/operations/color_darken.d.ts.map +1 -0
- package/src/core/color/operations/color_darken.js +27 -0
- package/src/core/color/operations/color_desaturate.d.ts +8 -0
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -0
- package/src/core/color/operations/color_desaturate.js +27 -0
- package/src/core/color/operations/color_lighten.d.ts +8 -0
- package/src/core/color/operations/color_lighten.d.ts.map +1 -0
- package/src/core/color/operations/color_lighten.js +27 -0
- package/src/core/color/operations/color_saturate.d.ts +8 -0
- package/src/core/color/operations/color_saturate.d.ts.map +1 -0
- package/src/core/color/operations/color_saturate.js +27 -0
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
package/build/meep.module.js
CHANGED
|
@@ -54427,19 +54427,26 @@ class Color {
|
|
|
54427
54427
|
/**
|
|
54428
54428
|
*
|
|
54429
54429
|
* @param {Color} input
|
|
54430
|
-
* @param {Color} output
|
|
54430
|
+
* @param {Color} [output]
|
|
54431
|
+
* @returns {Color}
|
|
54431
54432
|
*/
|
|
54432
|
-
static from_linear_to_sRGB(input, output) {
|
|
54433
|
+
static from_linear_to_sRGB(input, output=new Color()) {
|
|
54434
|
+
|
|
54433
54435
|
linear_to_sRGB(output, 0, input, 0);
|
|
54436
|
+
|
|
54437
|
+
return output;
|
|
54434
54438
|
}
|
|
54435
54439
|
|
|
54436
54440
|
/**
|
|
54437
54441
|
*
|
|
54438
54442
|
* @param {Color} input
|
|
54439
|
-
* @param {Color} output
|
|
54443
|
+
* @param {Color} [output]
|
|
54444
|
+
* @returns {Color}
|
|
54440
54445
|
*/
|
|
54441
|
-
static from_sRGB_to_linear(input, output) {
|
|
54446
|
+
static from_sRGB_to_linear(input, output = new Color()) {
|
|
54442
54447
|
sRGB_to_linear(output, 0, input, 0);
|
|
54448
|
+
|
|
54449
|
+
return output;
|
|
54443
54450
|
}
|
|
54444
54451
|
}
|
|
54445
54452
|
|
|
@@ -114198,7 +114205,7 @@ class LightSystem extends AbstractContextSystem {
|
|
|
114198
114205
|
}
|
|
114199
114206
|
|
|
114200
114207
|
if (settings.preAllocateLightsAmbient !== undefined) {
|
|
114201
|
-
this.__three_light_cache.reserve(LightType.
|
|
114208
|
+
this.__three_light_cache.reserve(LightType.AMBIENT, settings.preAllocateLightsAmbient);
|
|
114202
114209
|
}
|
|
114203
114210
|
}
|
|
114204
114211
|
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;IAumBI;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,KAAK,CAIjB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,KAAK,CAQhB;IAGD;;;;OAIG;IACH,kBAHW,MAAM,GACL,KAAK,CAQhB;IAED
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;IAumBI;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,KAAK,CAIjB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,KAAK,CAQhB;IAGD;;;;OAIG;IACH,kBAHW,MAAM,GACL,KAAK,CAQhB;IAED;;;;;OAKG;IACH,kCAJW,KAAK,WACL,KAAK,GACH,KAAK,CAOjB;IAED;;;;;OAKG;IACH,kCAJW,KAAK,WACL,KAAK,GACH,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IAED;;;OAGG;IACH,gBAFW,MAAM,QAUhB;IAED;;;;OAIG;IACH,SAFa,MAAM,CAQlB;IAED;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,cAFW,KAAK,WAOf;IAED;;;OAGG;IACH,YAFW,KAAK,QAKf;IAED;;;OAGG;IACH,SAFa,KAAK,CAQjB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;;aAEC;IAED;;;;;MAOC;IAWD;;;;;OAKG;IACH,sBAJW,MAAM,EAAE,uBACR,MAAM,GACJ,MAAM,EAAE,CASpB;IAED;;;;OAIG;IACH,kBAHW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,QAShB;IAGD;;;OAGG;IACH,2CAKC;IAED;;;OAGG;IACH,6CAOC;IAED;;;;OAIG;IACH,WAHW,MAAM,GACJ,IAAI,CAYhB;IAED;;;;;OAKG;IACH,cAJW,KAAK,KACL,KAAK,KACL,MAAM,QAOhB;IAoEL;;;OAGG;IACH,sCAxJe,MAAM,EAAE,uBACR,MAAM,KACJ,MAAM,EAAE,CAsJG;IAnKxB,sDAOC;CAsJJ;;aAUS,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;cAMf,SAAS,KAAK,CAAC;gBAMf,SAAS,KAAK,CAAC;cAMf,SAAS,KAAK,CAAC;iBAMf,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;qBAMf,SAAS,KAAK,CAAC;;mBApvBN,4BAA4B"}
|
package/src/core/color/Color.js
CHANGED
|
@@ -678,19 +678,26 @@ export class Color {
|
|
|
678
678
|
/**
|
|
679
679
|
*
|
|
680
680
|
* @param {Color} input
|
|
681
|
-
* @param {Color} output
|
|
681
|
+
* @param {Color} [output]
|
|
682
|
+
* @returns {Color}
|
|
682
683
|
*/
|
|
683
|
-
static from_linear_to_sRGB(input, output) {
|
|
684
|
+
static from_linear_to_sRGB(input, output=new Color()) {
|
|
685
|
+
|
|
684
686
|
linear_to_sRGB(output, 0, input, 0);
|
|
687
|
+
|
|
688
|
+
return output;
|
|
685
689
|
}
|
|
686
690
|
|
|
687
691
|
/**
|
|
688
692
|
*
|
|
689
693
|
* @param {Color} input
|
|
690
|
-
* @param {Color} output
|
|
694
|
+
* @param {Color} [output]
|
|
695
|
+
* @returns {Color}
|
|
691
696
|
*/
|
|
692
|
-
static from_sRGB_to_linear(input, output) {
|
|
697
|
+
static from_sRGB_to_linear(input, output = new Color()) {
|
|
693
698
|
sRGB_to_linear(output, 0, input, 0);
|
|
699
|
+
|
|
700
|
+
return output;
|
|
694
701
|
}
|
|
695
702
|
}
|
|
696
703
|
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -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_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);
|
|
21
|
+
|
|
22
|
+
hsv[1] = clamp01(hsv[1] * (1 - amount));
|
|
23
|
+
|
|
24
|
+
okhsv_to_linear_srgb(r, ...hsv);
|
|
25
|
+
|
|
26
|
+
return r;
|
|
27
|
+
}
|
|
@@ -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 @@
|
|
|
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
|
+
}
|
|
@@ -106,7 +106,7 @@ class LightSystem extends AbstractContextSystem {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
if (settings.preAllocateLightsAmbient !== undefined) {
|
|
109
|
-
this.__three_light_cache.reserve(LightType.
|
|
109
|
+
this.__three_light_cache.reserve(LightType.AMBIENT, settings.preAllocateLightsAmbient);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|