@maas/vue-equipment 1.0.0-beta.22 → 1.0.0-beta.23

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "1.0.0-beta.21",
4
+ "version": "1.0.0-beta.22",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "unknown"
@@ -93,7 +93,9 @@ export function useNoiseApi({
93
93
  }
94
94
  function initialize() {
95
95
  resetContexts();
96
- if (!canvasRef.value || !offCanvasRef.value) return;
96
+ if (!canvasRef.value || !offCanvasRef.value) {
97
+ return;
98
+ }
97
99
  const maxCanvasDim = Math.max(width.value, height.value) * pixelRatio.value;
98
100
  const maxOffCanvasDim = maxCanvasDim / Math.sqrt(mappedOptions.tiles);
99
101
  const adjustedOffCanvasDim = findBiggerNumber(
@@ -105,11 +107,13 @@ export function useNoiseApi({
105
107
  offCanvasRef.value.width = dimensions.offWidth = adjustedOffCanvasDim;
106
108
  offCanvasRef.value.height = dimensions.offHeight = adjustedOffCanvasDim;
107
109
  context.value = canvasRef.value.getContext("2d", {
108
- alpha: false
110
+ alpha: mappedOptions.alpha,
111
+ colorSpace: mappedOptions.colorSpace
109
112
  });
110
113
  offContext.value = offCanvasRef.value.getContext("2d", {
111
- alpha: false,
112
- willReadFrequently: true
114
+ alpha: mappedOptions.alpha,
115
+ willReadFrequently: true,
116
+ colorSpace: mappedOptions.colorSpace
113
117
  });
114
118
  resetPixels();
115
119
  calculate();
@@ -12,4 +12,6 @@ export type MagicNoiseOptions = {
12
12
  tiles?: number;
13
13
  fps?: number;
14
14
  color?: string;
15
+ alpha?: boolean;
16
+ colorSpace?: 'srgb' | 'display-p3';
15
17
  };
@@ -2,6 +2,8 @@ const defaultOptions = {
2
2
  pixelSize: 2,
3
3
  tiles: 32,
4
4
  fps: 12,
5
- color: "white"
5
+ color: "white",
6
+ alpha: false,
7
+ colorSpace: "srgb"
6
8
  };
7
9
  export { defaultOptions };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "Our Frontend Toolkit, Free and Open Source",
4
- "version": "1.0.0-beta.22",
4
+ "version": "1.0.0-beta.23",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Robin Scholz",