@symbo.ls/scratch
Advanced tools
Comparing version 0.3.9 to 0.3.10
@@ -5,3 +5,3 @@ { | ||
"author": "Symbols", | ||
"version": "0.3.9", | ||
"version": "0.3.10", | ||
"files": [ | ||
@@ -8,0 +8,0 @@ "src" |
@@ -24,25 +24,2 @@ 'use strict' | ||
const setColor = (val, key) => { | ||
const [r, g, b, a = 1] = colorStringToRgbaArray(val.value || val) | ||
const alpha = parseFloat(a.toFixed(2)) | ||
const CSSVar = `--color-${key}` | ||
const rgb = `${r}, ${g}, ${b}` | ||
const value = `rgba(${rgb}, ${alpha})` | ||
return { | ||
var: CSSVar, | ||
rgb, | ||
alpha, | ||
value | ||
} | ||
} | ||
const setGradient = (val, key) => { | ||
const CSSVar = `--gradient-${key}` | ||
return { | ||
var: CSSVar, | ||
value: val.value || val | ||
} | ||
} | ||
export const getColor = value => { | ||
@@ -88,2 +65,27 @@ if (!isString(value)) { | ||
const setColor = (val, key) => { | ||
if (val.slice(0, 2) === '--') val = getColor(val.slice(2)) | ||
const CSSVar = `--color-${key}` | ||
const [r, g, b, a = 1] = colorStringToRgbaArray(val.value || val) | ||
const alpha = parseFloat(a.toFixed(2)) | ||
const rgb = `${r}, ${g}, ${b}` | ||
const value = `rgba(${rgb}, ${alpha})` | ||
return { | ||
var: CSSVar, | ||
rgb, | ||
alpha, | ||
value | ||
} | ||
} | ||
const setGradient = (val, key) => { | ||
const CSSVar = `--gradient-${key}` | ||
return { | ||
var: CSSVar, | ||
value: val.value || val | ||
} | ||
} | ||
const setThemeValue = theme => { | ||
@@ -90,0 +92,0 @@ const value = {} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26865
833