Skip to content

A package for color codes, color generation, color manupulation.

Notifications You must be signed in to change notification settings

amjadshad/color-god

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

color-god

A package for color codes, color generation, color manupulation.

Installation

You can install color-god via npm:

npm install color-god

Usage

colorCode

The colorCode object contains color names mapped to their RGB values.

const generatePalette = require('color-god');

// Example usage
const baseColor = '#3498db'; // Base color in hex format
const numColors = 5; // Number of colors in the palette

const colorPalette = generatePalette(baseColor, numColors);
console.log('Generated Color Palette:', colorPalette);

hexToRgb

The hexToRgb function converts a color from hexadecimal format to RGB format.

const hexToRgb = require('color-god');

// Example usage
const hexColor = '#3498db'; // Color in hex format

const rgbColor = hexToRgb(hexColor); 

This will output:

RGB Color: rgb(52, 152, 219)

colorCode

The colorCode object contains color names mapped to their RGB values.

const { colorCode } = require('color-god');

// Example usage
const colorName = 'red'; // Color name

const rgbColor = colorCode[colorName];
This will output:
RGB Color code: [255, 0, 0]

License

This package is open source and available under the MIT License.

About

A package for color codes, color generation, color manupulation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published