@fimbul-works/vec 1.0.2 → 1.1.0

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.
@@ -109,6 +109,11 @@ export declare class Vec4 {
109
109
  readonly z: number;
110
110
  readonly w: number;
111
111
  readonly xyzw: readonly number[];
112
+ readonly r: number;
113
+ readonly g: number;
114
+ readonly b: number;
115
+ readonly a: number;
116
+ readonly rgba: readonly number[];
112
117
  readonly magnitude: number;
113
118
  readonly magnitudeSq: number;
114
119
  readonly angleW: number;
@@ -284,7 +289,57 @@ export declare class Vec4 {
284
289
  * Sets both components of the vector at once.
285
290
  * @param xyzw - An array containing the new x, y and z components.
286
291
  */
287
- set xyzw(xyzw: [number, number, number, number] | number[]);
292
+ set xyzw(xyzw: [number, number, number, number]);
293
+ /**
294
+ * Gets the Red-component of a Color.
295
+ * @returns The Red-component.
296
+ */
297
+ get r(): number;
298
+ /**
299
+ * Sets the Red-component of a Color.
300
+ * @param r - The new Red-component.
301
+ */
302
+ set r(r: number);
303
+ /**
304
+ * Gets the Green-component of a Color.
305
+ * @returns The Green-component.
306
+ */
307
+ get g(): number;
308
+ /**
309
+ * Sets the Green-component of the Color.
310
+ * @param g - The new Green-component.
311
+ */
312
+ set g(g: number);
313
+ /**
314
+ * Gets the Blue-component of the color.
315
+ * @returns The Blue-component.
316
+ */
317
+ get b(): number;
318
+ /**
319
+ * Sets the Blue-component of the Color.
320
+ * @param b - The new Blue-component.
321
+ */
322
+ set b(b: number);
323
+ /**
324
+ * Gets the Alpha-component of the color.
325
+ * @returns The Alpha-component.
326
+ */
327
+ get a(): number;
328
+ /**
329
+ * Sets the Alpha-component of the Color.
330
+ * @param b - The new Alpha-component.
331
+ */
332
+ set a(a: number);
333
+ /**
334
+ * Gets a copy of the vector's components as an array.
335
+ * @returns An array containing the Red, Green, Blue and Alpha components of the Color.
336
+ */
337
+ get rgba(): [number, number, number, number];
338
+ /**
339
+ * Sets all components of the Color at once.
340
+ * @param rgba - An array containing the new Red, Green and Blue components.
341
+ */
342
+ set rgba(rgba: [number, number, number, number]);
288
343
  /**
289
344
  * Gets the angle between the vector and the positive x-axis in radians.
290
345
  * @returns The angle in radians, always in the range [0, 2π).