Skip to content

Commit

Permalink
Merge pull request #233 from jpudysz/feature/transparent
Browse files Browse the repository at this point in the history
feat: ios improve parsing transparent color
  • Loading branch information
jpudysz authored Jul 5, 2024
2 parents 947133b + c018b33 commit ae6612f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/parseColor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Color } from '../types'
import { isIOS } from '../common'

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

if (isIOS && color === 'transparent') {
return ['#000000', 0]
}

// todo remove this with Unistyles 3.0
// named colors
return [color, 1]
}

0 comments on commit ae6612f

Please sign in to comment.