Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kusstar/react-native-mesh-gradient

MeshGradient component for React Native.
https://github.com/kusstar/react-native-mesh-gradient

android animated-gradient mesh-gradient react-native

Last synced: about 1 month ago
JSON representation

MeshGradient component for React Native.

Awesome Lists containing this project

README

        

# react-native-mesh-gradient

MeshGradient for React Native.

https://github.com/KusStar/react-native-mesh-gradient/assets/21271495/35b84584-614e-4ffe-9801-1c6547b5eebc

You can download the example apk in [releases](https://github.com/KusStar/react-native-mesh-gradient/releases).

## Installation

Only supports Android for now.

```sh
# npm install @kuss/react-native-mesh-gradient
yarn add @kuss/react-native-mesh-gradient
```

## Usage

```js
import { MeshGradient } from "@kuss/react-native-mesh-gradient";

```

More at [example/App.tsx](./example/src/App.tsx)

## Interface

```ts
export type MeshGradientProps = {
style?: ViewStyle;
/**
* defaults to 2, > 0
*/
speed?: number;
/*
* defaults to ['red', 'yellow', 'green', 'blue'], must be four colors
*/
colors: string[];
/**
* defaults to 1, 0 - 2
*/
brightness?: number;
/**
* defaults to 1, 0 - 2
*/
contrast?: number;
/**
* defaults to 5, > 0
*/
frequency?: number;
/**
* defaults to 30, > 0
*/
amplitude?: number;
};
```

## Thanks

- The [shader](https://github.com/KusStar/react-native-mesh-gradient/blob/d676e2e3f560282835283117f052a78bdb1eb809/android/src/main/java/com/meshgradient/MeshGradientRenderer.kt#L17-L75) code is copied from [https://www.shadertoy.com/view/4t2SDh](https://www.shadertoy.com/view/4t2SDh) by [hahnzhu](https://www.shadertoy.com/user/hahnzhu).
- [Timeless's Api - Bing Random](https://apifox.com/apidoc/shared-faff130e-7aa3-42da-9f93-574b16c8acda/api-30781027), for getting the random bing wallpaper.

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)