rakibj / Color-Assistant

0 stars 0 forks source link

Color Assistant

Fast color solution for hyper casual games

Table of contents

  1. Features
  2. Theory
  3. Tutorial
  4. Custom Use Cases
  5. Importing palettes from websites
  6. Modifying the final color

Features

Theory

It is based around 3 data types.

Tutorial

Step 1: Creating Color Palette Settings

N|Solid

Step 2: Creating Color Palette

N|Solid

Step 3: Creating Project Color Setup

N|Solid

Step 4: Using

N|Solid

Custom Use cases

At the moment, it can change colors on meshes by taking the Shader property and the material index. So basically it changes the color on the required materials. If you want to use the palette colors on your custom class then you can do that. You can even change the colors during runtime. Here you will see an example to change the color of the line renderer with your own custom class

  1. Create your custom script. Name it 'LinePaletteSetter.cs'. You can use any name
  2. Extend it from 'RendererPaletteBase'
  3. Override the function 'SetPaletteColor'
  4. You have access to the field 'colorKey' which you need to set from inspector
  5. You have access to 'GetPaletteColor()' using which you can get the active palette color. Use the color that this function returns to set the color of whatever you want in the overriden function of Step 3
    public class LinePaletteSetter : RendererPaletteBase
    {
    public LineRenderer lineRenderer;
    public override void SetPaletteColor()
    {
        lineRenderer.startColor = GetPaletteColor();
        lineRenderer.endColor = GetPaletteColor();
    }
    }
  6. Add LineRenderer and make necessary adjustments on the inspector. Use 'Alt+C' to open up Project Color Setup and Reassign the color palette to make the changes take effect.

Importing palettes from websites

Import color palettes from any websites simply by creating a color palette and then copying it as CSS. Most popular website in this sector is Adobe Colors. You can create color palettes in different ways and save it in your Library. Then just copy the palette as CSS N|Solid Open any color palette inspector and you will see the colors show up in the clipboard section N|Solid Now click on 'Pin the colors' and then copy and paste colors as you like into your main palette

Modifying the final color

You can modify the final color by selecting the Project Color Setup and then checking values on Final Color Modifier section

  1. Check Contrast: It turns the color to Grayscale. Use this to check the contrast between foreground and background

N|Solid

  1. Final Color Modifier: Use this to change the brightness, saturation and contrast of the final color.

N|Solid

These are automatically disabled in builds as each take one extra draw calls