Skip to content

Commit ae6612f

Browse files
authored
Merge pull request #233 from jpudysz/feature/transparent
feat: ios improve parsing transparent color
2 parents 947133b + c018b33 commit ae6612f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/parseColor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Color } from '../types'
2+
import { isIOS } from '../common'
23

34
const parseAlpha = (alpha: number) => {
45
if (alpha > 1 || alpha < 0) {
@@ -22,6 +23,11 @@ export const parseColor = (color?: Color, alpha: number = 1): [string, number] =
2223
return [color, parseAlpha(alpha)]
2324
}
2425

26+
if (isIOS && color === 'transparent') {
27+
return ['#000000', 0]
28+
}
29+
30+
// todo remove this with Unistyles 3.0
2531
// named colors
2632
return [color, 1]
2733
}

0 commit comments

Comments
 (0)