@bacons/css-to-expo-linear-gradient
Version:
Convert a CSS linear gradient function to expo-linear-gradient props
20 lines (19 loc) • 449 B
TypeScript
/**
* Given a CSS string, returns props for rendering with `expo-linear-gradient`.
*
* ```tsx
* fromCSS('linear-gradient(180deg, #ff008450 0%, #fca40040 25%, #ffff0030 40%, #00ff8a20 60%, #00cfff40 75%, #cc4cfa50 100%);')
* ```
*/
export declare function fromCSS(str: string): {
start: {
x: number;
y: number;
};
end: {
x: number;
y: number;
};
colors: string[];
locations: number[];
};