We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9744957 + d2000ce commit dfd0dd0Copy full SHA for dfd0dd0
src/Colors/index.js
@@ -79,7 +79,7 @@ const normalizeColorToARGB = color => {
79
if (!targetColor) {
80
targetColor = color
81
}
82
- const check = /^#([0-9A-F]{3}|[0-9A-F]{6})$/i
+ const check = /^#([0-9A-F]{3}|[0-9A-F]{6}|[0-9A-F]{8})$/i
83
if (isString(targetColor) && check.test(targetColor)) {
84
let hex = check.exec(targetColor)[1]
85
if (hex.length === 3) {
@@ -90,7 +90,7 @@ const normalizeColorToARGB = color => {
90
})
91
.join('')
92
93
- targetColor = `0xff${hex}` * 1
+ targetColor = (hex.length === 8 ? `0x${hex}` : `0xff${hex}`) * 1
94
95
if (!normalizedColors[color]) {
96
normalizedColors[color] = targetColor
0 commit comments