@colijnit/corecomponents_v12 254.1.1 → 254.1.2
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/bundles/colijnit-corecomponents_v12.umd.js +26 -0
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/service/color-sequence.service.js +27 -1
- package/fesm2015/colijnit-corecomponents_v12.js +26 -0
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/service/color-sequence.service.d.ts +3 -0
- package/package.json +1 -1
|
@@ -13975,6 +13975,32 @@
|
|
|
13975
13975
|
this.colors.set(id, result);
|
|
13976
13976
|
return result;
|
|
13977
13977
|
};
|
|
13978
|
+
ColorSequenceService.prototype.GetRandomColorWithSettings = function (h, s, l, a) {
|
|
13979
|
+
if (!h || !Array.isArray(h) || h.length < 2) {
|
|
13980
|
+
h = [0, 360];
|
|
13981
|
+
}
|
|
13982
|
+
if (!s || !Array.isArray(s) || s.length < 2) {
|
|
13983
|
+
s = [0, 100];
|
|
13984
|
+
}
|
|
13985
|
+
if (!l || !Array.isArray(l) || l.length < 2) {
|
|
13986
|
+
l = [0, 100];
|
|
13987
|
+
}
|
|
13988
|
+
if (!a || !Array.isArray(a) || a.length < 2) {
|
|
13989
|
+
a = [0, 1];
|
|
13990
|
+
}
|
|
13991
|
+
var hue = this.GetRandomNumber(h[0], h[1]);
|
|
13992
|
+
var saturation = this.GetRandomNumber(s[0], s[1]);
|
|
13993
|
+
var lightness = this.GetRandomNumber(l[0], l[1]);
|
|
13994
|
+
var alpha = this.GetRandomNumber(a[0] * 100, a[1] * 100) / 100;
|
|
13995
|
+
return this.GetHSLAColor(hue, saturation, lightness, alpha);
|
|
13996
|
+
};
|
|
13997
|
+
ColorSequenceService.prototype.GetRandomNumber = function (low, high) {
|
|
13998
|
+
var r = Math.floor(Math.random() * (high - low + 1)) + low;
|
|
13999
|
+
return r;
|
|
14000
|
+
};
|
|
14001
|
+
ColorSequenceService.prototype.GetHSLAColor = function (h, s, l, a) {
|
|
14002
|
+
return "hsl(" + h + ", " + s + "%, " + l + "%, " + a + ")";
|
|
14003
|
+
};
|
|
13978
14004
|
return ColorSequenceService;
|
|
13979
14005
|
}());
|
|
13980
14006
|
ColorSequenceService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ColorSequenceService_Factory() { return new ColorSequenceService(); }, token: ColorSequenceService, providedIn: "root" });
|