com.dss.color-palettes

1.3.2 • Public • Published

Color Palettes

A system to keep UnityEngine.Graphic colors consistent throughout a project.

Example

palette

In this palette, I've declared three name-color pairs corresponding to the background, text, and an accent color. You can add as many name-color pairs, but the names should be unique from each other.

container

In this palette container, I've added the dark theme from before, as well as other themes. I can easily swap between them by checking the appropriate box (as well as through custom scripts).

apply

I've added an ApplyColorPalette component to Image component, and set it to use the "accent" color from the previous palette container. Notice that the container itself acts as a palette. (We could have just as easily dropped in a single color palette instance as well).

Demo

demo

How To Install

The color-palettes package uses the scoped registry feature to import dependent packages. Please add the following sections to the package manifest file (Packages/manifest.json).

To the scopedRegistries section:

{
  "name": "DSS",
  "url": "https://registry.npmjs.com",
  "scopes": [ "com.dss" ]
}

To the dependencies section:

"com.dss.color-palettes": "1.3.2"

After changes, the manifest file should look like below:

{
  "scopedRegistries": [
    {
      "name": "DSS",
      "url": "https://registry.npmjs.com",
      "scopes": [ "com.dss" ]
    }
  ],
  "dependencies": {
    "com.dss.color-palettes": "1.3.2",
    ...

/com.dss.color-palettes/

    Package Sidebar

    Install

    npm i com.dss.color-palettes

    Weekly Downloads

    0

    Version

    1.3.2

    License

    BSD-3-Clause

    Unpacked Size

    36.5 kB

    Total Files

    38

    Last publish

    Collaborators

    • danielshervheim