@uni-design-system/uni-core 0.0.26 → 0.0.27
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.
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.uniColor = exports.hslaToString = void 0;
|
|
4
4
|
const color_types_1 = require("./color.types");
|
|
5
5
|
const color_utils_1 = require("./color.utils");
|
|
6
|
-
function hslaToString({ hue, saturation, lightness, alpha }) {
|
|
7
|
-
return `hsla(${hue}, ${saturation}
|
|
6
|
+
function hslaToString({ hue, saturation, lightness, alpha = 1 }) {
|
|
7
|
+
return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;
|
|
8
8
|
}
|
|
9
9
|
exports.hslaToString = hslaToString;
|
|
10
10
|
function uniColor({ role, category, alpha = 1 }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":";;;AACA,+CAAgF;AAChF,+CAAiD;AAEjD,SAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAQ;
|
|
1
|
+
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":";;;AACA,+CAAgF;AAChF,+CAAiD;AAEjD,SAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,EAAQ;IAC1E,OAAO,QAAQ,GAAG,KAAK,UAAU,MAAM,SAAS,MAAM,KAAK,GAAG,CAAC;AACjE,CAAC;AAFD,oCAEC;AAED,SAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAY;IAC9D,MAAM,GAAG,GAAG,IAAA,8BAAgB,EAAC,sBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,8BAAgB,EAAC,gCAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAA,8BAAgB,EAAC,+BAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhE,OAAO,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7D,CAAC;AAND,4BAMC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CategoryLightness, CategorySaturation, RoleHues } from './color.types';
|
|
2
2
|
import { randomRangeValue } from './color.utils';
|
|
3
|
-
export function hslaToString({ hue, saturation, lightness, alpha }) {
|
|
4
|
-
return `hsla(${hue}, ${saturation}
|
|
3
|
+
export function hslaToString({ hue, saturation, lightness, alpha = 1 }) {
|
|
4
|
+
return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;
|
|
5
5
|
}
|
|
6
6
|
export function uniColor({ role, category, alpha = 1 }) {
|
|
7
7
|
const hue = randomRangeValue(RoleHues[role]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAQ;
|
|
1
|
+
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,EAAQ;IAC1E,OAAO,QAAQ,GAAG,KAAK,UAAU,MAAM,SAAS,MAAM,KAAK,GAAG,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAY;IAC9D,MAAM,GAAG,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhE,OAAO,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED