Commit 08dfca1
committed
fix: coerce NaN Lab/OKLab channels to 0 in parseColor
color-mix() resolved at compile time by lightningcss can yield NaN
chromaticity channels for degenerate mixes (e.g. mixing black with
transparent in oklab). Passing NaN to colorjs.io produced an invalid
color string like "#NaNNaNNaN80" that React Native silently discards,
so utilities such as Tailwind's bg-black/50 rendered with no background.
Treat NaN channels as 0 (a missing component per CSS Color 4) for the
lab/lch/oklab/oklch cases, so the example resolves to #80.
Fixes #3171 parent 5b7ad9d commit 08dfca1
2 files changed
Lines changed: 53 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1612 | 1612 | | |
1613 | 1613 | | |
1614 | 1614 | | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1615 | 1627 | | |
1616 | 1628 | | |
1617 | 1629 | | |
| |||
1666 | 1678 | | |
1667 | 1679 | | |
1668 | 1680 | | |
1669 | | - | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1670 | 1686 | | |
1671 | 1687 | | |
1672 | 1688 | | |
1673 | 1689 | | |
1674 | 1690 | | |
1675 | 1691 | | |
1676 | | - | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
1677 | 1697 | | |
1678 | 1698 | | |
1679 | 1699 | | |
1680 | 1700 | | |
1681 | 1701 | | |
1682 | 1702 | | |
1683 | | - | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
1684 | 1708 | | |
1685 | 1709 | | |
1686 | 1710 | | |
1687 | 1711 | | |
1688 | 1712 | | |
1689 | 1713 | | |
1690 | | - | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
1691 | 1719 | | |
1692 | 1720 | | |
1693 | 1721 | | |
| |||
0 commit comments