@fbltd/math 1.0.48 → 1.0.50

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.
@@ -63,7 +63,7 @@ export class Color {
63
63
  return new Color((value & 0xFF0000) >> 24, (value & 0xFF0000) >> 16, (value & 0xFF00) >> 8, value & 0xFF);
64
64
  }
65
65
  static toNumber(color) {
66
- return (((color.red << 16) | color.green) << 16) | color.blue;
66
+ return color.red << 16 | color.green << 8 | color.blue;
67
67
  }
68
68
  static areEquals(c1, c2) {
69
69
  return Color.toNumber(c1) === Color.toNumber(c2);
@@ -63,9 +63,7 @@ export class BaseGradient {
63
63
  isColorInRange(color) {
64
64
  return Boolean(this.getPercentageByColor(color));
65
65
  }
66
- static restorationColor(startColor, endColor, value, startValue = 0, endValue = 1) {
67
- if (value < startValue || value > endValue)
68
- throw new Error("invalid value");
66
+ static restoreColor(startColor, endColor, value, startValue = 0, endValue = 1) {
69
67
  if (value === startValue)
70
68
  return startColor;
71
69
  if (value === endValue)
@@ -14,5 +14,5 @@ export declare abstract class BaseGradient {
14
14
  isColorInRange(color: Color): boolean;
15
15
  abstract toCanvas(ctx: CanvasRenderingContext2D, ...args: any): CanvasGradient;
16
16
  abstract toCSS(...args: any): string;
17
- static restorationColor(startColor: Color, endColor: Color, value: number, startValue?: number, endValue?: number): Color;
17
+ static restoreColor(startColor: Color, endColor: Color, value: number, startValue?: number, endValue?: number): Color;
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fbltd/math",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "Math and geometry utilities",
5
5
  "sideEffects": false,
6
6
  "main": "dist/bin/index.js",