@xort/cga 0.0.80 → 0.0.81
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.
- package/dist/math/Color.js +6 -0
- package/package.json +1 -1
- package/src/math/Color.ts +6 -0
package/dist/math/Color.js
CHANGED
|
@@ -99,6 +99,12 @@ var Color = /** @class */ (function (_super) {
|
|
|
99
99
|
else if (typeof value === 'number') {
|
|
100
100
|
this.setHex(value);
|
|
101
101
|
}
|
|
102
|
+
if (typeof value === 'string') {
|
|
103
|
+
if (value.indexOf("#") === 0)
|
|
104
|
+
this.setHexCssString(value);
|
|
105
|
+
else
|
|
106
|
+
console.error("未匹配的颜色数据");
|
|
107
|
+
}
|
|
102
108
|
return this;
|
|
103
109
|
};
|
|
104
110
|
Color.prototype.setHex = function (hex) {
|
package/package.json
CHANGED
package/src/math/Color.ts
CHANGED
|
@@ -70,6 +70,12 @@ export class Color extends EventHandler {
|
|
|
70
70
|
} else if (typeof value === 'number') {
|
|
71
71
|
this.setHex(value);
|
|
72
72
|
}
|
|
73
|
+
if (typeof value === 'string') {
|
|
74
|
+
if (value.indexOf("#") === 0)
|
|
75
|
+
this.setHexCssString(value);
|
|
76
|
+
else
|
|
77
|
+
console.error("未匹配的颜色数据")
|
|
78
|
+
}
|
|
73
79
|
|
|
74
80
|
return this;
|
|
75
81
|
}
|