color-god

1.0.4 • Public • Published

color-god

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

Installation

You can install color-god via npm:

npm install color-god

Usage

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:

```bash
RGB Color code: [255, 0, 0]
## License

This package is open source and available under the [MIT License](https://opensource.org/licenses/MIT).

Package Sidebar

Install

npm i color-god

Weekly Downloads

153

Version

1.0.4

License

MIT

Unpacked Size

8.79 kB

Total Files

8

Last publish

Collaborators

  • amjadshad