@fimbul-works/vec 1.0.3 → 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.
@@ -130,6 +130,10 @@ export declare class Vec3 {
130
130
  readonly y: number;
131
131
  readonly z: number;
132
132
  readonly xyz: readonly number[];
133
+ readonly r: number;
134
+ readonly g: number;
135
+ readonly b: number;
136
+ readonly rgb: readonly number[];
133
137
  readonly magnitude: number;
134
138
  readonly magnitudeSq: number;
135
139
  readonly angleX: number;
@@ -289,10 +293,50 @@ export declare class Vec3 {
289
293
  */
290
294
  get xyz(): [number, number, number];
291
295
  /**
292
- * Sets both components of the vector at once.
296
+ * Sets all components of the vector at once.
293
297
  * @param xyz - An array containing the new x, y and z components.
294
298
  */
295
- set xyz(xyz: [number, number, number] | number[]);
299
+ set xyz(xyz: [number, number, number]);
300
+ /**
301
+ * Gets the Red-component of a Color.
302
+ * @returns The Red-component.
303
+ */
304
+ get r(): number;
305
+ /**
306
+ * Sets the Red-component of a Color.
307
+ * @param r - The new Red-component.
308
+ */
309
+ set r(r: number);
310
+ /**
311
+ * Gets the Green-component of a Color.
312
+ * @returns The Green-component.
313
+ */
314
+ get g(): number;
315
+ /**
316
+ * Sets the Green-component of the Color.
317
+ * @param g - The new Green-component.
318
+ */
319
+ set g(g: number);
320
+ /**
321
+ * Gets the Blue-component of the color.
322
+ * @returns The Blue-component.
323
+ */
324
+ get b(): number;
325
+ /**
326
+ * Sets the Blue-component of the Color.
327
+ * @param b - The new Blue-component.
328
+ */
329
+ set b(b: number);
330
+ /**
331
+ * Gets a copy of the vector's components as an array.
332
+ * @returns An array containing the x, y and z components of the vector.
333
+ */
334
+ get rgb(): [number, number, number];
335
+ /**
336
+ * Sets all components of the Color at once.
337
+ * @param rgb - An array containing the new Red, Green and Blue components.
338
+ */
339
+ set rgb(rgb: [number, number, number]);
296
340
  /**
297
341
  * Gets the angle between the vector and the positive x-axis in radians.
298
342
  * @returns The angle in radians, always in the range [0, 2π).