@js-draw/math 1.2.0 → 1.2.1

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.
@@ -85,6 +85,9 @@ class Color4 {
85
85
  if (text === 'none' || text === 'transparent') {
86
86
  return Color4.transparent;
87
87
  }
88
+ if (text === '') {
89
+ return Color4.black;
90
+ }
88
91
  // rgba?: Match both rgb and rgba strings.
89
92
  // ([,0-9.]+): Match any string of only numeric, '.' and ',' characters.
90
93
  const rgbRegex = /^rgba?\(([,0-9.]+)\)$/i;
@@ -79,6 +79,9 @@ class Color4 {
79
79
  if (text === 'none' || text === 'transparent') {
80
80
  return Color4.transparent;
81
81
  }
82
+ if (text === '') {
83
+ return Color4.black;
84
+ }
82
85
  // rgba?: Match both rgb and rgba strings.
83
86
  // ([,0-9.]+): Match any string of only numeric, '.' and ',' characters.
84
87
  const rgbRegex = /^rgba?\(([,0-9.]+)\)$/i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-draw/math",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A math library for js-draw. ",
5
5
  "types": "./dist/mjs/lib.d.ts",
6
6
  "main": "./dist/cjs/lib.js",
@@ -45,5 +45,5 @@
45
45
  "svg",
46
46
  "math"
47
47
  ],
48
- "gitHead": "3e77c7d833ecdc13bcb57e905280ba547629680a"
48
+ "gitHead": "0cb756d3150c8b33dd9a3217faa7d18229688f34"
49
49
  }
package/src/Color4.ts CHANGED
@@ -93,6 +93,10 @@ export default class Color4 {
93
93
  return Color4.transparent;
94
94
  }
95
95
 
96
+ if (text === '') {
97
+ return Color4.black;
98
+ }
99
+
96
100
  // rgba?: Match both rgb and rgba strings.
97
101
  // ([,0-9.]+): Match any string of only numeric, '.' and ',' characters.
98
102
  const rgbRegex = /^rgba?\(([,0-9.]+)\)$/i;