daisyui 4.1.0-alpha.7 → 4.1.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/package.json +1 -1
- package/src/theming/functions.js +3 -7
package/package.json
CHANGED
package/src/theming/functions.js
CHANGED
|
@@ -3,12 +3,8 @@ import { variables, themesOrder } from "./themeDefaults"
|
|
|
3
3
|
|
|
4
4
|
import { toGamut, interpolate, wcagContrast } from "culori"
|
|
5
5
|
|
|
6
|
-
const cutNumber = (number) =>
|
|
7
|
-
|
|
8
|
-
return 0
|
|
9
|
-
}
|
|
10
|
-
return +number.toFixed(6)
|
|
11
|
-
}
|
|
6
|
+
const cutNumber = (number) => (number ? +number.toFixed(6) : 0)
|
|
7
|
+
const toGamutOKLCH = toGamut("oklch")
|
|
12
8
|
|
|
13
9
|
export function isDark(color) {
|
|
14
10
|
if (wcagContrast(color, "black") < wcagContrast(color, "white")) {
|
|
@@ -37,7 +33,7 @@ export function convertColorFormat(input) {
|
|
|
37
33
|
|
|
38
34
|
Object.entries(input).forEach(([rule, value]) => {
|
|
39
35
|
if (colorNames.hasOwnProperty(rule)) {
|
|
40
|
-
const colorObj =
|
|
36
|
+
const colorObj = toGamutOKLCH(value)
|
|
41
37
|
resultObj[colorNames[rule]] = colorObjToString(colorObj)
|
|
42
38
|
} else {
|
|
43
39
|
resultObj[rule] = value
|