Skip to content

Instantly share code, notes, and snippets.

@keijiro
Last active November 15, 2021 09:42
Show Gist options
  • Save keijiro/46ab4443b68f5424dcf52b7317a44790 to your computer and use it in GitHub Desktop.
Save keijiro/46ab4443b68f5424dcf52b7317a44790 to your computer and use it in GitHub Desktop.

Pugrad

photo

Pugrad is a color gradient generator for Unity that supports commonly-used perceptually uniform colormaps.

At the moment, Pugrad supports the following colormaps:

screenshot

How To Install

This package uses the scoped registry feature to resolve package dependencies. Please add the following sections to the manifest file (Packages/manifest.json).

To the scopedRegistries section:

{
  "name": "Keijiro",
  "url": "https://registry.npmjs.com",
  "scopes": [ "jp.keijiro" ]
}

To the dependencies section:

"jp.keijiro.pugrad": "1.0.0"

After changes, the manifest file should look like below:

{
  "scopedRegistries": [
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [ "jp.keijiro" ]
    }
  ],
  "dependencies": {
    "jp.keijiro.pugrad": "1.0.0",
...

How To Use

To cerate a colormap, select Assets -> Create -> Pugrad. It creates a .pugrad file that generates a Texture2D asset procedurally.

inspector

You can change the resolution of the texture on the inspector. You can also change the lightness of the gradient when using the HSLuv colormap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment