@mll-lab/js-utils 2.36.0 → 2.37.0
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/index.common.js +110 -21
- package/dist/index.common.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +110 -21
- package/dist/index.js.map +1 -1
- package/dist/stringToColor.d.ts +13 -3
- package/package.json +3 -3
package/dist/stringToColor.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type StringToHslaColorOptions = {
|
|
2
|
+
opacity?: number;
|
|
3
|
+
};
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
5
|
+
* Provides a hsla color value for use in CSS, based on the contents of the given string.
|
|
6
|
+
*
|
|
7
|
+
* See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl.
|
|
8
|
+
*
|
|
9
|
+
* @example stringToHslaColor('test') becomes 'hsla(58, 98%, 48%, 1)' (yellow)
|
|
10
|
+
*
|
|
11
|
+
* This function tries to provide a good spread of colors for different inputs.
|
|
12
|
+
* However, it does not guarantee uniqueness - think of it like hashing.
|
|
13
|
+
* It is pure, meaning that the result is only dependent on the inputs.
|
|
4
14
|
*/
|
|
5
|
-
export declare function
|
|
15
|
+
export declare function stringToHslaColor(string: string, { opacity }?: StringToHslaColorOptions): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mll-lab/js-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.0",
|
|
4
4
|
"main": "dist/index.common.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"date-fns": "3.0.1",
|
|
42
|
-
"lodash": "4.17.
|
|
42
|
+
"lodash": "4.17.21"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/core": "^7.13.1",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"ts-node": "^9.1.1",
|
|
80
80
|
"typescript": "^5.3.3"
|
|
81
81
|
},
|
|
82
|
-
"packageManager": "yarn@4.
|
|
82
|
+
"packageManager": "yarn@4.4.0"
|
|
83
83
|
}
|