Files
react-native-svg/lib/rgba.js
2016-06-10 23:33:18 +08:00

15 lines
337 B
JavaScript

import Color from 'color';
let noneFill = ['transparent', 'none'];
export default function (color, opacity) {
if (noneFill.indexOf(color) !== -1 || !color) {
return Color('#000');
} else {
let c = Color(color);
if (!isNaN(opacity)) {
c = c.alpha(opacity);
}
return c;
}
}