mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 16:04:38 +00:00
Run Prettier, configure ESLint.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import Color from 'color';
|
||||
import patternReg from './patternReg';
|
||||
import Color from "color";
|
||||
import patternReg from "./patternReg";
|
||||
|
||||
export default function (colorOrBrush) {
|
||||
if (colorOrBrush === 'none' || !colorOrBrush) {
|
||||
export default function(colorOrBrush) {
|
||||
if (colorOrBrush === "none" || !colorOrBrush) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,11 @@ export default function (colorOrBrush) {
|
||||
if (matched) {
|
||||
return [1, matched[1]];
|
||||
//todo:
|
||||
} else { // solid color
|
||||
let [r, g, b, a = 1] = Color(colorOrBrush).rgb().array();
|
||||
} else {
|
||||
// solid color
|
||||
let [r, g, b, a = 1] = Color(colorOrBrush)
|
||||
.rgb()
|
||||
.array();
|
||||
return [0, r / 255, g / 255, b / 255, a];
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user