fix rgba css generation, add some tests to automatically verify that themes are
generated properly
This commit is contained in:
parent
d7e7f47b66
commit
7c074b8741
8 changed files with 116 additions and 84 deletions
|
@ -171,7 +171,7 @@ export const mixrgb = (a, b) => {
|
|||
* @returns {String} CSS rgba() color
|
||||
*/
|
||||
export const rgba2css = function (rgba) {
|
||||
return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`
|
||||
return `rgba(${Math.floor(rgba.r)}, ${Math.floor(rgba.g)}, ${Math.floor(rgba.b)}, .5)`
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -353,7 +353,7 @@ export const getColors = (sourceColors, sourceOpacity, mod) => SLOT_ORDERED.redu
|
|||
if (dependencySlot && sourceColors[dependencySlot] === 'transparent') {
|
||||
outputColor.a = 0
|
||||
} else {
|
||||
outputColor.a = sourceOpacity[opacitySlot] || OPACITIES[opacitySlot].defaultValue || 1
|
||||
outputColor.a = Number(sourceOpacity[opacitySlot]) || OPACITIES[opacitySlot].defaultValue || 1
|
||||
}
|
||||
}
|
||||
if (opacitySlot) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue