Skip to content

Commit 1812ef8

Browse files
committed
Cleanup formatting
1 parent b316f95 commit 1812ef8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/styles.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ const opacity = (color, opacity) => {
1414
// values.
1515
let hex = color.replace('#', '')
1616
hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex
17-
const r = parseInt(hex.substring(0, 2), 16)
18-
const g = parseInt(hex.substring(2, 4), 16)
19-
const b = parseInt(hex.substring(4, 6), 16)
17+
18+
let r = parseInt(hex.substring(0, 2), 16)
19+
let g = parseInt(hex.substring(2, 4), 16)
20+
let b = parseInt(hex.substring(4, 6), 16)
2021

2122
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
2223
return `color-mix(in oklab, ${color} ${opacity}, transparent)`
2324
}
25+
2426
return `rgb(${r}, ${g}, ${b} / ${opacity})`
2527
}
2628

0 commit comments

Comments
 (0)