MCPcopy Index your code
hub / github.com/EvanBacon/css-to-expo-linear-gradient

github.com/EvanBacon/css-to-expo-linear-gradient @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
12 symbols 25 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

@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.

Core symbols most depended-on inside this repo

calculateGradientDirection
called by 11
src/index.ts
parseTopRight
called by 4
src/index.ts
parseLinearGradient
called by 2
src/index.ts
parseAngle
called by 1
src/index.ts
distance
called by 1
src/index.ts
parseGradient
called by 1
src/index.ts
parseColorStops
called by 1
src/index.ts
parsePosition
called by 1
src/index.ts

Shape

Function 12

Languages

TypeScript100%

Modules by API surface

src/index.ts12 symbols

For agents

$ claude mcp add css-to-expo-linear-gradient \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact