@orusteam/solariscore 2.5.4 → 2.5.5
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/dist/index.js +23 -0
- package/dist/utils/ColorUtil.d.ts +7 -1
- package/dist/utils/ColorUtil.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -571,6 +571,19 @@ var ChunkUtil = class _ChunkUtil {
|
|
|
571
571
|
|
|
572
572
|
// src/utils/ColorUtil.ts
|
|
573
573
|
var ColorUtil = class {
|
|
574
|
+
static colorToRgb(color) {
|
|
575
|
+
if (typeof color === "string") {
|
|
576
|
+
return this.hexToRgb(color);
|
|
577
|
+
}
|
|
578
|
+
if (Array.isArray(color)) {
|
|
579
|
+
return {
|
|
580
|
+
red: color[0],
|
|
581
|
+
green: color[1],
|
|
582
|
+
blue: color[2]
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
return color;
|
|
586
|
+
}
|
|
574
587
|
static hexToRgb(hex) {
|
|
575
588
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
576
589
|
return {
|
|
@@ -579,6 +592,16 @@ var ColorUtil = class {
|
|
|
579
592
|
blue: result ? parseInt(result[3], 16) / 255 : 0
|
|
580
593
|
};
|
|
581
594
|
}
|
|
595
|
+
static rgbToTuple(rgb) {
|
|
596
|
+
return [rgb.red, rgb.green, rgb.blue];
|
|
597
|
+
}
|
|
598
|
+
static tupleToRgb(tuple) {
|
|
599
|
+
return {
|
|
600
|
+
red: tuple[0],
|
|
601
|
+
green: tuple[1],
|
|
602
|
+
blue: tuple[2]
|
|
603
|
+
};
|
|
604
|
+
}
|
|
582
605
|
};
|
|
583
606
|
|
|
584
607
|
// src/utils/DateUtil.ts
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { RGB } from "@minecraft/server";
|
|
2
|
-
|
|
2
|
+
type RGBTuple = [r: number, g: number, b: number];
|
|
3
|
+
type Color = RGB | RGBTuple | string;
|
|
4
|
+
declare class ColorUtil {
|
|
5
|
+
static colorToRgb(color: Color): RGB;
|
|
3
6
|
static hexToRgb(hex: string): RGB;
|
|
7
|
+
static rgbToTuple(rgb: RGB): RGBTuple;
|
|
8
|
+
static tupleToRgb(tuple: RGBTuple): RGB;
|
|
4
9
|
}
|
|
10
|
+
export { Color, ColorUtil, RGBTuple };
|
|
5
11
|
//# sourceMappingURL=ColorUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ColorUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAIxC,
|
|
1
|
+
{"version":3,"file":"ColorUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ColorUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAIxC,KAAK,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAClD,KAAK,KAAK,GAAG,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC;AAIrC,cAAM,SAAS;IACX,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG;IAgBpC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG;IASjC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ;IAIrC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG;CAO1C;AAID,OAAO,EACH,KAAK,EACL,SAAS,EACT,QAAQ,EACX,CAAC"}
|