laymur 0.10.0 → 0.10.2

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,6 +1,5 @@
1
1
  import { Eventail } from "eventail";
2
- import type { Color } from "three";
3
- import { Vector4 } from "three";
2
+ import { Color, Vector4 } from "three";
4
3
  /**
5
4
  * Predefined color names supported by UIColor.
6
5
  */
@@ -27,18 +26,23 @@ export declare class UIColor extends Eventail {
27
26
  private rgbDirty;
28
27
  private hslDirty;
29
28
  constructor();
29
+ /**
30
+ * @param r - Red (0-1)
31
+ * @param g - Green (0-1)
32
+ * @param b - Blue (0-1)
33
+ * @param a - Alpha (0-1)
34
+ */
35
+ constructor(r: number, g: number, b: number, a?: number);
30
36
  /**
31
37
  * @param colorName - Named color
32
38
  * @param a - Alpha (0-1)
33
39
  */
34
40
  constructor(colorName: UIColorName, a?: number);
35
41
  /**
36
- * @param r - Red (0-1)
37
- * @param g - Green (0-1)
38
- * @param b - Blue (0-1)
42
+ * @param threeColor - Three.js Color object
39
43
  * @param a - Alpha (0-1)
40
44
  */
41
- constructor(r: number, g: number, b: number, a?: number);
45
+ constructor(threeColor: Color, a?: number);
42
46
  /**
43
47
  * @param hexRGB - Hex RGB value (e.g., 0xFF0000)
44
48
  * @param a - Alpha (0-1)
@@ -193,6 +197,14 @@ export declare class UIColor extends Eventail {
193
197
  * @throws Error if color name is unknown
194
198
  */
195
199
  setColorName(colorName: UIColorName, a?: number): this;
200
+ /**
201
+ * Sets color from Three.js Color object.
202
+ *
203
+ * @param threeColor - Three.js Color object
204
+ * @param a - Alpha (0-1)
205
+ * @returns This instance
206
+ */
207
+ setThreeColor(threeColor: Color, a?: number): this;
196
208
  /**
197
209
  * Returns CSS rgba() string.
198
210
  */
@@ -204,6 +216,13 @@ export declare class UIColor extends Eventail {
204
216
  * @returns Vector4 with linear RGB (0-1) and alpha
205
217
  */
206
218
  toGLSLColor(result?: Vector4): Vector4;
219
+ /**
220
+ * Converts color to Three.js Color object (without alpha).
221
+ *
222
+ * @param result - Color object to store the result
223
+ * @returns Color with RGB values
224
+ */
225
+ toThreeColor(result?: Color): Color;
207
226
  /**
208
227
  * Copies values from another color.
209
228
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laymur",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Constraint-based UI library for Three.js mobile advertisements",
5
5
  "scripts": {
6
6
  "clean": "rm -rf dist",