Skip to content

Create variant color palettes from a single color and generate code for them.

License

Notifications You must be signed in to change notification settings

andremalveira/palette

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



Color Palette

Create variant color palettes from a single color and generate code for them.

License-MIT   NPM Version


Install

npm i @andevjs/palette

How to use

import createPalette from "@andevjs/palette";

const primaryColor = createPalette("#9e8cfc");

Type

types are also available to import
import { CreatePalette, Palette } from "@andevjs/palette";

type CreatePalette = (color: string, altColor?: string) => Palette;

color - Main Color
altColor - Alternative to the main color, for example, if the main color is too light or too dark, alternate a color with a darker tone to the light color, or a lighter tone to the dark color.

Return

type Palette = {
  light: string;
  main: string;
  hover: string;
  alt: string;
  dark: string;
  shad: string;
  over: string;
};

Developed by @andremalveira © 2022 | License MIT