https://github.com/gilzoide/unity-gradient-rect
Component that draws a Gradient using Unity UI
https://github.com/gilzoide/unity-gradient-rect
gradient package plugin ugui ui unity unity-ui unity3d
Last synced: about 1 year ago
JSON representation
Component that draws a Gradient using Unity UI
- Host: GitHub
- URL: https://github.com/gilzoide/unity-gradient-rect
- Owner: gilzoide
- License: unlicense
- Created: 2023-04-27T23:28:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T21:33:47.000Z (almost 3 years ago)
- Last Synced: 2025-03-17T05:11:24.500Z (about 1 year ago)
- Topics: gradient, package, plugin, ugui, ui, unity, unity-ui, unity3d
- Language: C#
- Homepage:
- Size: 3.66 MB
- Stars: 26
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Gradient Rect
[](https://openupm.com/packages/com.gilzoide.gradient-rect/)
Unity UI components with color [Gradients](https://docs.unity3d.com/ScriptReference/Gradient.html) embedded in their meshes.

## Features
- Uses Unity's built-in Gradient class.
- Supports additional color tint, 2D textures and sprites.
- Supports custom materials and masking.
Gradient colors are embedded in the generated meshes, the components will never mess with your materials.
- Supports mesh modifiers, like Outline and Shadow.
## How to install
Either:
- Install using [openupm](https://openupm.com/):
```
openupm add com.gilzoide.gradient-rect
```
- Install via [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui-giturl.html) using the following URL:
```
https://github.com/gilzoide/unity-gradient-rect.git#1.1.0
```
## Components:
- [GradientRect](Runtime/GradientRect.cs): rectangle colored with Gradient colors.
- [GradientTexture](Runtime/GradientTexture.cs): texture with configurable UV, tinted with Gradient colors.
- [GradientImage](Runtime/GradientImage.cs): sprite tinted with Gradient colors.
UVs are automatically fetched from sprite data.
Only simple filling is supported, no slicing nor tiling.