@bacons/css-to-expo-linear-gradient
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

@bacons/css-to-expo-linear-gradient

Demo: snack

Convert a CSS linear gradient function to expo-linear-gradient props.

Add the package to your npm dependencies

yarn add @bacons/css-to-expo-linear-gradient

Usage

import { fromCSS } from "@bacons/css-to-expo-linear-gradient";
import { LinearGradient } from "expo-linear-gradient";

function App() {
  return (
    <LinearGradient
      {...fromCSS(
        `linear-gradient(0deg, #ff008450 0%, #fca40040 25%, #ffff0030 40%, #00ff8a20 60%, #00cfff40 75%, #cc4cfa50 100%);`
      )}
    />
  );
}

Attribution

Most of the code is adapted from this project which converts CSS linear gradients to canvas gradients.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    992
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    992
  • 1.2.0
    0
  • 1.1.0
    0
  • 1.0.0
    63

Package Sidebar

Install

npm i @bacons/css-to-expo-linear-gradient

Weekly Downloads

1,055

Version

1.3.0

License

MIT

Unpacked Size

38.2 kB

Total Files

10

Last publish

Collaborators

  • evanbacon