54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
// Metro module 8549 (f8550).
|
|
import { processColor } from "react-native";
|
|
import { convertPercentageColor } from "./percentTo255";
|
|
let c5480_3 = /^url\(#(.+)\)$/;
|
|
let c5480_4 = {
|
|
type: 2
|
|
};
|
|
let c5480_5 = {
|
|
type: 3
|
|
};
|
|
let c5480_6 = {
|
|
type: 4
|
|
};
|
|
export default function extractBrush(a0) {
|
|
let r30, payload;
|
|
if (a0 === "none") {
|
|
return null;
|
|
}
|
|
if (a0 === "currentColor") {
|
|
return c5480_4;
|
|
}
|
|
if (a0 === "context-fill") {
|
|
return c5480_5;
|
|
}
|
|
if (a0 === "context-stroke") {
|
|
return c5480_6;
|
|
}
|
|
const r4 = typeof a0 === "string" ? a0.match(c5480_3) : typeof a0 === "string";
|
|
if (r4) {
|
|
return {
|
|
type: 1,
|
|
brushRef: r4[1]
|
|
};
|
|
}
|
|
L12: {
|
|
L11: {
|
|
payload = processColor(convertPercentageColor(a0));
|
|
if (typeof payload !== "number") {
|
|
if (typeof payload === "object" && payload !== null) {
|
|
break L11;
|
|
}
|
|
console.warn(`"${String(a0)}" is not a valid color or brush`);
|
|
r30 = null;
|
|
break L12;
|
|
}
|
|
}
|
|
r30 = {
|
|
type: 0,
|
|
payload
|
|
};
|
|
}
|
|
return r30;
|
|
};
|