ismx-nexo-node-app 0.4.130 → 0.4.131

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.
@@ -93,5 +93,8 @@ class ColorUtils {
93
93
  let alphaHex = Math.round(transparency * 255).toString(16).padStart(2, '0');
94
94
  return color + alphaHex;
95
95
  }
96
+ static isColor(color) {
97
+ return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
98
+ }
96
99
  }
97
100
  exports.default = ColorUtils;
@@ -9,4 +9,5 @@ export default abstract class ColorUtils {
9
9
  static interpolate(color1: string, color2: string, ratio: number): string;
10
10
  static contrast(color: string): string;
11
11
  static transparency(color: string, transparency: number): string;
12
+ static isColor(color: string): boolean;
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.130",
3
+ "version": "0.4.131",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -85,4 +85,8 @@ export default abstract class ColorUtils {
85
85
  let alphaHex = Math.round(transparency * 255).toString(16).padStart(2, '0');
86
86
  return color + alphaHex;
87
87
  }
88
+
89
+ static isColor(color: string): boolean {
90
+ return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
91
+ }
88
92
  }