mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-02 23:02:16 +00:00
fix rgba fill and stroke bug
This commit is contained in:
+7
-2
@@ -1,9 +1,14 @@
|
||||
import Color from 'color';
|
||||
let noneFill = ['transparent', 'none'];
|
||||
export default function (color, opacity = 1) {
|
||||
export default function (color, opacity) {
|
||||
if (noneFill.indexOf(color) !== -1 || !color) {
|
||||
return Color('#000');
|
||||
} else {
|
||||
return Color(color).alpha(+opacity);
|
||||
let c = Color(color);
|
||||
|
||||
if (!isNaN(opacity)) {
|
||||
c = c.alpha(opacity);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user