Skip to content

Commit

Permalink
fix alpha values
Browse files Browse the repository at this point in the history
  • Loading branch information
libertymayc committed Apr 22, 2024
1 parent ed9e8e1 commit 8655e8c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 55 deletions.
2 changes: 1 addition & 1 deletion packages/theme/json/parsers/colorFormatSwap.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function colorFormatSwap(swapTo, color) {
.replace("rgba(", "")
.replace(")", "")
.split(",")
.map((x) => parseInt(x.trim()));
.map((x) => parseFloat(x.trim()));
a = ((a * 255) | (1 << 8)).toString(16).slice(1).trim();
return rgbToHex(r, g, b) + a;
} else {
Expand Down
100 changes: 46 additions & 54 deletions packages/theme/json/theme.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"modes": [
"$light",
"$dark"
],
"densities": [
"$high",
"$medium",
"$low",
"$touch"
],
"modes": ["$light", "$dark"],
"densities": ["$high", "$medium", "$low", "$touch"],
"palette": {
"accent": {
"palette-accent": {
Expand Down Expand Up @@ -642,36 +634,36 @@
"shadow": {
"shadow-100-color": {
"$value": {
"$dark": "#00000000",
"$light": "#00000000"
"$dark": "#0000007f",
"$light": "#00000019"
},
"$type": "color"
},
"shadow-200-color": {
"$value": {
"$dark": "#00000000",
"$light": "#00000000"
"$dark": "#0000007f",
"$light": "#00000019"
},
"$type": "color"
},
"shadow-300-color": {
"$value": {
"$dark": "#00000000",
"$light": "#00000000"
"$dark": "#0000008c",
"$light": "#00000026"
},
"$type": "color"
},
"shadow-400-color": {
"$value": {
"$dark": "#00000000",
"$light": "#00000000"
"$dark": "#0000008c",
"$light": "#00000033"
},
"$type": "color"
},
"shadow-500-color": {
"$value": {
"$dark": "#00000000",
"$light": "#00000000"
"$dark": "#000000a5",
"$light": "#0000004c"
},
"$type": "color"
},
Expand Down Expand Up @@ -821,10 +813,10 @@
},
"size-indicator": {
"$value": {
"$low": "3px",
"$touch": "4px",
"$medium": "2px",
"$high": "1px"
"$low": "4px",
"$touch": "5px",
"$medium": "3px",
"$high": "2px"
},
"$type": "dimension"
},
Expand Down Expand Up @@ -977,7 +969,7 @@
"$type": "color"
},
"color-asphalt-40a": {
"$value": "#18191a00",
"$value": "#18191a66",
"$type": "color"
},
"color-autumn-400": {
Expand All @@ -997,23 +989,23 @@
"$type": "color"
},
"color-black-15a": {
"$value": "#00000000",
"$value": "#00000026",
"$type": "color"
},
"color-black-25a": {
"$value": "#00000000",
"$value": "#0000003f",
"$type": "color"
},
"color-black-40a": {
"$value": "#00000000",
"$value": "#00000066",
"$type": "color"
},
"color-black-70a": {
"$value": "#00000000",
"$value": "#000000b2",
"$type": "color"
},
"color-black-8a": {
"$value": "#00000000",
"$value": "#00000014",
"$type": "color"
},
"color-blue-100": {
Expand All @@ -1025,55 +1017,55 @@
"$type": "color"
},
"color-blue-200-40a": {
"$value": "#a7cbea00",
"$value": "#a7cbea66",
"$type": "color"
},
"color-blue-300": {
"$value": "#83b0d8",
"$type": "color"
},
"color-blue-300-40a": {
"$value": "#83b0d800",
"$value": "#83b0d866",
"$type": "color"
},
"color-blue-400": {
"$value": "#5c95c7",
"$type": "color"
},
"color-blue-400-40a": {
"$value": "#5c95c700",
"$value": "#5c95c766",
"$type": "color"
},
"color-blue-500": {
"$value": "#2b7cb5",
"$type": "color"
},
"color-blue-500-40a": {
"$value": "#2b7cb500",
"$value": "#2b7cb566",
"$type": "color"
},
"color-blue-600": {
"$value": "#1f6494",
"$type": "color"
},
"color-blue-600-40a": {
"$value": "#1f649400",
"$value": "#1f649466",
"$type": "color"
},
"color-blue-700": {
"$value": "#134d75",
"$type": "color"
},
"color-blue-700-40a": {
"$value": "#134d7500",
"$value": "#134d7566",
"$type": "color"
},
"color-blue-800": {
"$value": "#073757",
"$type": "color"
},
"color-blue-800-40a": {
"$value": "#07375700",
"$value": "#07375766",
"$type": "color"
},
"color-blue-900": {
Expand Down Expand Up @@ -1165,51 +1157,51 @@
"$type": "color"
},
"color-gray-300-15a": {
"$value": "#adaeb300",
"$value": "#adaeb326",
"$type": "color"
},
"color-gray-300-40a": {
"$value": "#adaeb300",
"$value": "#adaeb366",
"$type": "color"
},
"color-gray-400": {
"$value": "#8f9198",
"$type": "color"
},
"color-gray-400-40a": {
"$value": "#8f919800",
"$value": "#8f919866",
"$type": "color"
},
"color-gray-500": {
"$value": "#72757d",
"$type": "color"
},
"color-gray-500-15a": {
"$value": "#72757d00",
"$value": "#72757d26",
"$type": "color"
},
"color-gray-500-40a": {
"$value": "#72757d00",
"$value": "#72757d66",
"$type": "color"
},
"color-gray-600": {
"$value": "#5b5d64",
"$type": "color"
},
"color-gray-600-40a": {
"$value": "#5b5d6400",
"$value": "#5b5d6466",
"$type": "color"
},
"color-gray-700": {
"$value": "#45474d",
"$type": "color"
},
"color-gray-700-15a": {
"$value": "#45474d00",
"$value": "#45474d26",
"$type": "color"
},
"color-gray-700-40a": {
"$value": "#45474d00",
"$value": "#45474d66",
"$type": "color"
},
"color-gray-800": {
Expand Down Expand Up @@ -1309,7 +1301,7 @@
"$type": "color"
},
"color-mist-40a": {
"$value": "#f2f4f600",
"$value": "#f2f4f666",
"$type": "color"
},
"color-ocean-400": {
Expand All @@ -1329,7 +1321,7 @@
"$type": "color"
},
"color-oil-40a": {
"$value": "#27282900",
"$value": "#27282966",
"$type": "color"
},
"color-olive-400": {
Expand Down Expand Up @@ -1517,7 +1509,7 @@
"$type": "color"
},
"color-snow-40a": {
"$value": "#ffffff00",
"$value": "#ffffff66",
"$type": "color"
},
"color-teal-100": {
Expand Down Expand Up @@ -1577,23 +1569,23 @@
"$type": "color"
},
"color-white-15a": {
"$value": "#ffffff00",
"$value": "#ffffff26",
"$type": "color"
},
"color-white-25a": {
"$value": "#ffffff00",
"$value": "#ffffff3f",
"$type": "color"
},
"color-white-40a": {
"$value": "#ffffff00",
"$value": "#ffffff66",
"$type": "color"
},
"color-white-70a": {
"$value": "#ffffff00",
"$value": "#ffffffb2",
"$type": "color"
},
"color-white-8a": {
"$value": "#ffffff00",
"$value": "#ffffff14",
"$type": "color"
}
},
Expand Down Expand Up @@ -2309,4 +2301,4 @@
}
}
}
}
}

0 comments on commit 8655e8c

Please sign in to comment.